Please finish support for OSC 4 and friends #464

Open
opened 2026-01-30 21:52:57 +00:00 by claunia · 0 comments
Owner

Originally created by @Jaykul on GitHub (Dec 6, 2018).

Originally assigned to: @zadjii-msft on GitHub.

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...

  1. OSC 4 should support multiple colors. XTerm and tmux (and others) support multiple pairs of index;spec without having to repeat the ESC]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.
  2. It doesn't allow setting the extended xterm 88 or 256 color palette (see #313).
  3. 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 😉

Originally created by @Jaykul on GitHub (Dec 6, 2018). Originally assigned to: @zadjii-msft on GitHub. 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](http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands). 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... 1. OSC 4 should support multiple colors. XTerm and tmux (and others) support multiple _pairs_ of `index;spec` without having to repeat the `ESC]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. 2. It doesn't allow setting the extended xterm 88 or 256 color palette (see #313). 3. 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 😉
claunia added the Issue-FeatureProduct-ConhostResolution-Fix-AvailableArea-VT labels 2026-01-30 21:52:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#464