Change colors in console/virtual terminal

colorscommand lineconsoleescape-charactersvim

Is there a way to alter all the available colors in console / virtual terminal?
By console, I mean what you get after pressing CTRL + ALT + F1 and not anything like xterm or urxvt. So, I guess that would mean alter

I can change 8 of the colors using escape sequences like so:

echo -en "\e]PY######"

where Y is the numerical id of the color (0 to 7) and ###### is the hex color value.

My ultimate goal is to port the solarized color scheme to the console, because I want to look vim all the same regardless of whether I'm in console or X.

Any suggestions on this?

htop in xterm:
htop in xterm, solarized colors

htop in console, after applying the 8 colors:
htop in console, after applying the 8 colors I could

Best Answer

TTY framebuffer console has no way to have more than 8-16 colors without kernel hacking, see this quote: "Although the Linux frame-buffer supports 256 (or more) colors, the Linux console driver does not; therefore, console applications are still limited to 16 colors on the Linux console, frame-buffer or not."

So you can have no more than 16 or 8 colors. There is tutorial how to change colors for framebuffer terminal (aka ctrl+alt+1) using same commands as you described in ~/.bashrc: colors in TTY tutorial

Related Question