Pregunta

I have my xterm inherit RGB values for its "color table" from an X resource file. As far as I understand, xterm does not just support 256 colors - it supports 256 color references pointing each to a 24-bit RGB space color, correct?

I would like to be able to reset the colors themselves, for example change the color with index 10 to an RGB value #ff8000 or something.

I don't even know if I have got my concepts right here. If I have, is it possible to change entries in this "color table" at runtime - for the current terminal window? Or one can only do so with xrdb for next opened terminal instance?

¿Fue útil?

Solución

I'm not sure if this actually works (my xterm here isn't compiled with 256 color support!) but the xterm control sequence reference:

http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Look under "Operating System Controls"

P s = 4 ; c ; spec → Change Color Number c to the color specified by spec. This can be a name or RGB specification as per XParseColor. Any number of c name pairs may be given. The color numbers correspond to the ANSI colors 0-7, their bright versions 8-15, and if supported, the remainder of the 88-color or 256-color table.

OSC is \033], so try this out:

echo -n -e '\033]4;7;red\007'

should change color #7 to red if it works.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top