Add support for SGR 58/59 (underline coloring)#15599
Add support for SGR 58/59 (underline coloring)#15599tusharsnx wants to merge 3 commits intomicrosoft:mainfrom
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
| const auto r = GetRValue(color); | ||
| const auto g = GetGValue(color); | ||
| const auto b = GetBValue(color); | ||
| return _WriteFormatted(FMT_COMPILE("\x1b[58;2;{};{};{}m"), r, g, b); |
There was a problem hiding this comment.
Can these use colon-separated subparameters? So as to minimise the risk that applications ignorant of underline colors treat the RGB numbers as separate attributes.
There was a problem hiding this comment.
I see what you mean, may be we can do only : instead, but that would require removing the invalidation of : as a CSI parameter delimiter (conditionally). Thanks for the heads up.
There was a problem hiding this comment.
I see, it's blocked by #4321.
I guess, this comment explains the blinking issue, and why we need to prefer using |
Adds support for colon `:` separated sub parameters in parser. Technically, after this PR, nothing should change except, now sub parameters are parsed, stored safely and we don't invalidate the whole sequence when a `:` is received within a parameter substring. In this PR: - If sub parameters are detected with a parameter, but the usage is unrecognised, we simply *skip* the parameter in `adaptDispatch`. - A separate store for sub parameters is used to avoid too many changes to the codebase. - We currently allow up to `6` sub parameters for each parameter, extra sub parameters are *ignored*. - Introduced `VTSubParameters` for easy access to underlying sub parameters. > **Info**: We don't use sub parameters for any feature yet, this is just the core implementation to support newer usecases. ## Validation Steps Performed - [x] Use of sub parameters must not have any effect on the output. - [x] Skip parameters with unexpected set of sub parameters. - [x] Skip sequences with unexpected set of sub parameters. References #4321 References #7228 References #15599 References xtermjs/xterm.js#2751 Closes #4321
|
closing this in favour of: #15795 |


Summary of the Pull Request
Adds support for underline coloring with SGR 58/59 sequences. ConPTY can now parse, store and send those sequences across console applications and client terminal app.
Tested it on Wezterm which already has support for drawing colored underlines. For testing, I replaced the prebundled
OpenConsole.exeandconpty.dllfrom Wezterm with the modified versions.Above code produces output like so:
Left: Wezterm, Right: WindowsTerminal Dev

Changes aren't visible on WindowsTerminal as of now. Atleast one of the graphic render, E.g. AtlasEngine, needs to support coloring of underline and drawing them on screen. Will be working on this in next few days.
References and Relevant Issues
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
PR Checklist