[PR #15795] Add support for underline style and color in VT #30736

Open
opened 2026-01-31 09:42:40 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15795

State: closed
Merged: Yes


Add support for underline style and color in VT.

Underline color sequence SGR 58 (unlike SGR 38, SGR 48) only works with sub parameters, eg. \e[58:5:<n>m or \e[58:2::<r>:<g>:<b>m will work, but something like \e[58;5;<n>m won't work. This is a requirement for the implementation to avoid problems with VT clients that don't support sub parameters.

Detailed Description

  • Added underlineColor to TextAttribute, and UnderlineStyle into CharacterAttributes.
  • Added two new entries in GraphicOptions namely, UnderlineColor (58) and UnderlineColorDefault (59).
  • SGR 58 renders a sequence with sub parameters in the VT renderer.
  • SGR 4:x renders a sequence with sub parameters in the VT renderer, except for single, double, and no-underline, which still use backward-compatible SGR 4, SGR 21 and SGR 24.
  • XtermEngine will send \e[4m without any styling information. This means all underline style (except NoUnderline) will be rendered as single underline.

Reference issues

PR Checklist

  • Use pre-calculated maps for efficient mapping between CharacterAttributes and UnderlineStyle. (Not required)
  • update DECRARA, DECCARA to respect underline color and style.
  • update DECRQSS to send underline color and style in the query response.
  • update DECRQPSR/DECRSPS/DECCIR
  • Tests added
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15795 **State:** closed **Merged:** Yes --- Add support for underline style and color in VT. Underline color sequence _SGR 58_ (unlike *SGR 38*, *SGR 48*) only works with sub parameters, eg. `\e[58:5:<n>m` or `\e[58:2::<r>:<g>:<b>m` will work, but something like `\e[58;5;<n>m` won't work. This is a requirement for the implementation to avoid problems with VT clients that don't support sub parameters. ## Detailed Description - Added `underlineColor` to `TextAttribute`, and `UnderlineStyle` into `CharacterAttributes`. - Added two new entries in `GraphicOptions` namely, `UnderlineColor` (58) and `UnderlineColorDefault` (59). - _SGR 58_ renders a sequence with sub parameters in the VT renderer. - _SGR 4:x_ renders a sequence with sub parameters in the VT renderer, except for single, double, and no-underline, which still use backward-compatible _SGR 4_, _SGR 21_ and _SGR 24_. - `XtermEngine` will send `\e[4m` without any styling information. This means all underline style (except NoUnderline) will be rendered as single underline. ## Reference issues - #7228 ### PR Checklist - [x] ~Use pre-calculated maps for efficient mapping between `CharacterAttributes` and `UnderlineStyle`.~ (Not required) - [x] update DECRARA, DECCARA to respect underline color and style. - [x] update DECRQSS to send underline color and style in the query response. - [x] update DECRQPSR/DECRSPS/DECCIR - [x] Tests added
claunia added the pull-request label 2026-01-31 09:42:40 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30736