Unexpected ANSI sequence behavior in cmd.exe #17639

Closed
opened 2026-01-31 05:48:38 +00:00 by claunia · 6 comments
Owner

Originally created by @Zeek05 on GitHub (Jun 5, 2022).

Windows Terminal version

No response

Windows build number

Microsoft Windows [Version 10.0.22000.675]

Other Software

cmd.exe

Steps to reproduce

Apply any SGR sequence that affects character attributes in cmd.

Expected Behavior

IMG_9665

LEFT: You can see that the ANSI escape sequences in Windows Terminal are working as intended.

Actual Behavior

RIGHT: These changes are not propagating to CMD.exe, resizing the screen creates this bleeding effect.

This issue is related to #32

Originally created by @Zeek05 on GitHub (Jun 5, 2022). ### Windows Terminal version _No response_ ### Windows build number Microsoft Windows [Version 10.0.22000.675] ### Other Software cmd.exe ### Steps to reproduce Apply any SGR sequence that affects character attributes in cmd. ### Expected Behavior ![IMG_9665](https://user-images.githubusercontent.com/61340927/172073492-c08616b5-00cb-41bd-a573-899bc12ea869.png) **LEFT:** You can see that the ANSI escape sequences in Windows Terminal are working as intended. ### Actual Behavior **RIGHT**: These changes are not propagating to CMD.exe, resizing the screen creates this bleeding effect. This issue is related to #32
claunia added the Issue-BugResolution-DuplicateProduct-Terminal labels 2026-01-31 05:48:39 +00:00
Author
Owner

@Zeek05 commented on GitHub (Jun 5, 2022):

I had contacted MS support for this issue and they redirected me to this GitHub. I am not sure how this is relevant to Terminal but, I am using cmd.exe and this place seems the most relevant.

Edit: Why is the image so compressed? 😂

@Zeek05 commented on GitHub (Jun 5, 2022): I had contacted MS support for this issue and they redirected me to this GitHub. I am not sure how this is relevant to Terminal but, I am using cmd.exe and this place seems the most relevant. Edit: Why is the image so compressed? 😂
Author
Owner

@DHowett commented on GitHub (Jun 6, 2022):

I am not sure how this is relevant to Terminal

Good news! The code for Windows Terminal and the legacy console window are both here in this repository.

I bet you're seeing an issue we've since fixed, where attributes get extended across the screen when the window is resized. That was #32, and it applied to any text styling (color, underline, hyperlink, ...)

What is tat?

@DHowett commented on GitHub (Jun 6, 2022): > I am not sure how this is relevant to Terminal Good news! The code for Windows Terminal *and* the legacy console window are both here in this repository. I bet you're seeing an issue we've since fixed, where attributes get extended across the screen when the window is resized. That was #32, and it applied to any text styling (color, underline, hyperlink, ...) What is `tat`?
Author
Owner

@Zeek05 commented on GitHub (Jun 6, 2022):

I am not sure how this is relevant to Terminal

Good news! The code for Windows Terminal and the legacy console window are both here in this repository.

I bet you're seeing an issue we've since fixed, where attributes get extended across the screen when the window is resized. That was #32, and it applied to any text styling (color, underline, hyperlink, ...)

What is tat?

tat is an application I am developing.

Shortest explanation is, it simply sends the escape sequences to STDOUT.
So, when I do tat underline it's just emitting the underline escape sequence to stdout

I have the latest version of windows and conhost, I am not sure why the bug is persisting then? This was a screenshot yesterday..

Specifically for underlining, the program does the following:
printf("\x1b[4m");

On Windows Terminal, it works just as expected. However on conhost it is not.

@Zeek05 commented on GitHub (Jun 6, 2022): > > I am not sure how this is relevant to Terminal > > Good news! The code for Windows Terminal _and_ the legacy console window are both here in this repository. > > I bet you're seeing an issue we've since fixed, where attributes get extended across the screen when the window is resized. That was #32, and it applied to any text styling (color, underline, hyperlink, ...) > > What is `tat`? tat is an application I am developing. Shortest explanation is, it simply sends the escape sequences to STDOUT. So, when I do `tat underline` it's just emitting the underline escape sequence to stdout I have the latest version of windows and conhost, I am not sure why the bug is persisting then? This was a screenshot yesterday.. Specifically for underlining, the program does the following: ` printf("\x1b[4m");` On Windows Terminal, it works just as expected. However on conhost it is not.
Author
Owner

@237dmitry commented on GitHub (Jun 6, 2022):

Resizing terminal window works as %esc%[0m

Screenshot 2022-06-06 130742

@237dmitry commented on GitHub (Jun 6, 2022): Resizing terminal window works as `%esc%[0m` ![Screenshot 2022-06-06 130742](https://user-images.githubusercontent.com/78153320/172141005-54be4a3d-39ec-4c7b-a33c-22fff6fb79b8.png)
Author
Owner

@zadjii-msft commented on GitHub (Jun 6, 2022):

Yea, this looks like a combo of #32 with {that one issue where we were initializing the buffer with the current attributes, not the default ones}. I'd reckon that the conhost changes to fix #32 aren't in 10.0.22000.675, but should be available in the next major Win11 release. (I don't know what that build number will be yet).

/dup #32

@zadjii-msft commented on GitHub (Jun 6, 2022): Yea, this looks like a combo of #32 with {that one issue where we were initializing the buffer with the current attributes, not the default ones}. I'd reckon that the conhost changes to fix #32 aren't in 10.0.22000.675, but should be available in the next major Win11 release. (I don't know what that build number will be yet). /dup #32
Author
Owner

@ghost commented on GitHub (Jun 6, 2022):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jun 6, 2022): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17639