I have a color scheme that I like for when I'm in a terminal, but I ssh into the machine I work on from multiple sources (locally, PuTTY, my netbook, etc.) and I want to maintain the same color scheme throughout. Is this possible?
I especially want it in PuTTY; it's difficult to change PuTTY colors.
Best Answer
Colors in terminals are determined in two steps:
Xterm has an escape sequence to change the color value associated with a color number. I don't remember whether PuTTY supports this sequence; I know Mintty does.
These settings won't survive a terminal reset. You can overcome this difficulty by appending the cursor configuration changing sequence to your terminal's reset string.
infocmp >>~/etc/terminfo.txt
. Edit the description to change thers1
(basic reset) sequence, e.g. replacers1=\Ec
byrs1=\Ec\E]4;4;#6495ed\E\\
. With some programs and settings, you may need to change thers2
(full reset) as well. Then compile the terminfo description withtic ~/etc/terminfo.txt
(this writes under the directory$TERMINFO
, or~/.terminfo
if unset)./etc/termcap
). Change theis
(basic reset) andrs
(full reset) sequences to append your settings, e.g.:is=\Ec\Ec\E]4;4;#6495ed\E\\:
. Set theTERMCAP
environment variable to the edited value (beginning and ending with:
).Now you can put something like this in your
~/.profile
: