Console-Docs icon indicating copy to clipboard operation
Console-Docs copied to clipboard

DECAC support needs to be documented

Open zadjii-msft opened this issue 2 years ago • 1 comments

  • https://github.com/microsoft/terminal/issues/6574#issuecomment-1176558196
  • https://github.com/microsoft/terminal/pull/13058
  • DECAC docs (search for "DECAC—Assign Color")

zadjii-msft avatar Jul 06 '22 18:07 zadjii-msft

Copying my notes from the original thread:

In short, though: DECAC can assign the frame and default indices each to any other color from the xterm 256-color palette (by index -- therefore, if you reassign what that index means, you can change that color no matter where it is used).

James' PR also added 263 and 264 as virtual indices that contain the tab foreground and background, respectively. You can change them using OSC 4. These are technically unrelated to DECAC[1].

So at runtime, you can change the tab color programmatically by setting the color table entry at index 262 (sic: I think he meant 264) using OSC 4 (assuming you need a specific RGB value). Otherwise if you just want to set the tab color to an existing color index, you can use DECAC 2. @j4james in commit a69ce89

Therefore, this will change the tab background color to any RGB value (OSC 4):

image

And this will change the tab background color to "whatever the background color of the Terminal is" (DECAC):

image

Our documentation should clarify these new color indices since we're making a contract out of them, and it should further clarify the purpose of DECAC specifically.

[1] Technically. They're related because you can use DECAC to reassign "frame colors" to any two indices instead of 263 and 264.

DECAC is one thing, and the new indices are another. Two doc notes -- and probably something we should consider supporting in conhost using DWMWA too (!)

DHowett avatar Jul 06 '22 19:07 DHowett