256 colors in console (tty)

Suppose, I have a system without X server. I can only log in from the console. It seems, by default linux console supports only 8 colors:

# tput colors
8

Is it possible to use 256 colors in the console, same as I would use in a terminal emulator (ie terminator) ?

While googling, Ihave found many similar questions (many of them over 10 years old), but none clear answer. Somebody suggests to use framebuffer, some other people suggest to append TERM argument to kernel boot options.

At the moment, I only pass one extra option as kernel boot parameter:

append="video=1280x720"

I believe passing the video resolution only works in modern kernels with kernel mode setting support, but I am not sure about that.

Is it possible to use 256 colors in modern linux console (tty)

How?

I am using Debian Wheezy with kernel 4.1

UPDATE:

based on suggestion from @muru, I have tried fbterm. While it works with 256 colors, it has very ugly/garbled fonts. Besides, there is a constantly blinking cursor in the lower-left corner, which I find distracting.

Can I use 256 colors in the console without fbterm/framebuffer ?

Where does the 8 color limit in the console come from ?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The actual question consists of these two items:

  • Can I use 256 colors in the console without fbterm/framebuffer ?
  • Where does the 8 color limit in the console come from ?

To the first: apparently not. All of the suggested approaches use fbterm.
To the second: it comes from the terminal description (aka “terminfo entry”). For Linux console, with TERM set to linux, that says the terminal supports 8 colors. tput gets its information from the terminal database.

One of the items in the thread quoted says that fbterm uses different escape sequences for setting colors than xterm. If that is the case (and given the propensity of Emacs users to hardcode things), there’s no suitable terminal entry for fbterm.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x