-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
I was really happy to see support for OSC 4 to set the 16 palette colors (and I recently helped a friend add it to the docs, the way it is now) ...
However, I have some problems. I'm hoping you can address them all as one request, but I'm happy to split them out. First, as background the xterm control sequences docs. Obviously these are not sacred, but they do represent a sort-of standard in that other terminals and tmux have implemented these same sequences the same way...
- OSC 4 should support multiple colors. XTerm and tmux (and others) support multiple pairs of
index;specwithout having to repeat theESC]4;part, so you can do:ESC]4;0;rgb:00/00/00;1;rgb:00/00/70;...\\and list out the whole set of colors as one giant escape sequence. - It doesn't allow setting the extended xterm 88 or 256 color palette (see Unable to set colors above index 15 with OSC 4 #313).
- It doesn't support querying. I should be able to put a "?" in place of the rgb spec and get back a control sequence (which is supposed to be the exact same format), such that it could be used to set the color to the same RGB value it is already. This would allow me to check if I'm dealing with PowerShell blue instead of magenta by writing
ESC]4;5;?\\and parsing the output
Additionally ... without support for OSC 10 and 11 I cannot change the default foreground and background colors, so there's no way to fix (even temporarily) the fact that PowerShell is using 5 as it's default background color. NOTE that these should also support querying with a "?"
AND EVEN WORSE ...
We really also need support for OSC 104 (and 110 and 111) which would reset the colors changed by OSC 4, 10, and 11 to their defaults. Note that if done right, they support resetting individual colors, but as a first draft, I'd settle for the parameterless reset of the entire table -- and for my own purposes, if you implement 110 and 111 as meaning force WHITE text on a BLACK background, without implementing 10 and 11, I wouldn't cry 😉