XTPUSHSGR doesn't handle default and zero parameters correctly #16051

Closed
opened 2026-01-31 04:56:02 +00:00 by claunia · 7 comments
Owner

Originally created by @j4james on GitHub (Dec 4, 2021).

Windows Terminal version

1.12.2931.0

Windows build number

10.0.19041.1348

Other Software

No response

Steps to reproduce

  1. Open a bash shell.
  2. Execute the following statements:
printf "\033[0;4;7m\033[#p\033[m\033[#qREVERSE UNDERLINE\033[m\n"
printf "\033[0;4;7m\033[;4#p\033[m\033[#qUNDERLINE ONLY\033[m\n"
printf "\033[0;4;7m\033[0#p\033[m\033[#qNEITHER REVERSE NOR UNDERLINE\033[m\n"

Expected Behavior

The first line should be both reversed and underlined.
The second line should be underlined only.
The last line should be neither reversed nor underlined.

This is a screenshot from XTerm:
image

Actual Behavior

All three lines are displayed as reversed and underlined.

image

The problem is that we're interpreting zero parameters and default parameters to mean that all attributes should be saved. However, the documentation states that we should only be saving all attributes when no parameters have been specified at all.

Originally created by @j4james on GitHub (Dec 4, 2021). ### Windows Terminal version 1.12.2931.0 ### Windows build number 10.0.19041.1348 ### Other Software _No response_ ### Steps to reproduce 1. Open a bash shell. 2. Execute the following statements: ``` printf "\033[0;4;7m\033[#p\033[m\033[#qREVERSE UNDERLINE\033[m\n" printf "\033[0;4;7m\033[;4#p\033[m\033[#qUNDERLINE ONLY\033[m\n" printf "\033[0;4;7m\033[0#p\033[m\033[#qNEITHER REVERSE NOR UNDERLINE\033[m\n" ``` ### Expected Behavior The first line should be both reversed and underlined. The second line should be underlined only. The last line should be neither reversed nor underlined. This is a screenshot from XTerm: ![image](https://user-images.githubusercontent.com/4181424/144722651-7d6c11ce-8413-4b3f-a8ad-71dfe1a25cbb.png) ### Actual Behavior All three lines are displayed as reversed and underlined. ![image](https://user-images.githubusercontent.com/4181424/144722706-f3574628-76a5-4072-810b-9b35d2771ddd.png) The problem is that we're interpreting zero parameters and default parameters to mean that all attributes should be saved. However, the documentation states that we should only be saving all attributes when _no parameters_ have been specified at all.
Author
Owner

@elsaco commented on GitHub (Dec 6, 2021):

@j4james is there anything xterm specific in those test strings? On my Fedora workstation the xterm shows as above however gnome-terminal doesn't:

xterm test:

xterm

gnome-terminal test:
fish

@elsaco commented on GitHub (Dec 6, 2021): @j4james is there anything xterm specific in those test strings? On my Fedora workstation the xterm shows as above however gnome-terminal doesn't: xterm test: ![xterm](https://user-images.githubusercontent.com/3933920/144790501-d1abeaee-8f01-4f49-9932-2984fd206894.png) gnome-terminal test: ![fish](https://user-images.githubusercontent.com/3933920/144790520-c2f772ea-b025-48c5-8157-af219f549776.png)
Author
Owner

@j4james commented on GitHub (Dec 6, 2021):

VTE doesn't support XTPUSHSGR.

For reference, see https://gitlab.gnome.org/GNOME/vte/-/issues/23

@j4james commented on GitHub (Dec 6, 2021): VTE doesn't support `XTPUSHSGR`. For reference, see https://gitlab.gnome.org/GNOME/vte/-/issues/23
Author
Owner

@DHowett commented on GitHub (Dec 8, 2021):

/cc @jazzdelightsme for errata about XTPUSH/POP in Terminal 😄

@DHowett commented on GitHub (Dec 8, 2021): /cc @jazzdelightsme for errata about XTPUSH/POP in Terminal :smile:
Author
Owner

@DHowett commented on GitHub (Dec 8, 2021):

Unfortunately, this is broken in conhost in Windows 11 as well -- and is not likely to be fixed until the next release milestone (Windows 14?)

@DHowett commented on GitHub (Dec 8, 2021): Unfortunately, this is broken in conhost in Windows 11 as well -- and is not likely to be fixed until the next release milestone ~(Windows 14?)~
Author
Owner

@j4james commented on GitHub (Dec 8, 2021):

I don't think that's a big deal though. These are really edge cases. I just happened to notice them when I was testing my enumset changes.

@j4james commented on GitHub (Dec 8, 2021): I don't think that's a big deal though. These are really edge cases. I just happened to notice them when I was testing my enumset changes.
Author
Owner

@jazzdelightsme commented on GitHub (Dec 13, 2021):

Belated thank you for noticing and fixing this!

@jazzdelightsme commented on GitHub (Dec 13, 2021): Belated thank you for noticing and fixing this!
Author
Owner

@ghost commented on GitHub (Feb 3, 2022):

:tada:This issue was addressed in #11888, which has now been successfully released as Windows Terminal Preview v1.13.10336.0.🎉

Handy links:

@ghost commented on GitHub (Feb 3, 2022): :tada:This issue was addressed in #11888, which has now been successfully released as `Windows Terminal Preview v1.13.10336.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.13.10336.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16051