Background color attribute is filled incorrectly when resizing window #22057

Open
opened 2026-01-31 08:02:18 +00:00 by claunia · 1 comment
Owner

Originally created by @2trvl on GitHub (Aug 6, 2024).

Windows Terminal version

1.20.11781.0

Windows build number

10.0.19045.4651

Other Software

print("\033[?1049h")
print("\033[31m")
print("test")

Steps to reproduce

Use Virtual Terminal Sequences. Change background, print some text, resize window (rows+1) or maximize window.

Expected Behavior

The following result was obtained using the Windows API:

set_console_text_attribute(hConsoleOutput, WHITE_FORE + RED_BACK + NORMAL_STYLE)

image

Actual Behavior

1 row red, the following ones are already filled in correctly.

image

maximize window.

image

restoring the window and then maximizing it again fixes this error.

image

but it doesn't help for a single row.

image

It is worth summing up. Attributes are filled into new buffer cells correctly when using Windows Console Api. When using virtual codes, the described problem is observed. Also in Windows Console (cmd.exe) any window scaling, in both Windows Api and virtual codes, causes attributes to be filled incorrectly.

image
image
image

But this is known, and I understand that you are releasing all fixes in Windows Terminal.

Originally created by @2trvl on GitHub (Aug 6, 2024). ### Windows Terminal version 1.20.11781.0 ### Windows build number 10.0.19045.4651 ### Other Software ```python print("\033[?1049h") print("\033[31m") print("test") ``` ### Steps to reproduce Use Virtual Terminal Sequences. Change background, print some text, resize window (rows+1) or maximize window. ### Expected Behavior The following result was obtained using the Windows API: ```python set_console_text_attribute(hConsoleOutput, WHITE_FORE + RED_BACK + NORMAL_STYLE) ``` ![image](https://github.com/user-attachments/assets/ccabf7de-237a-412d-b649-c38c5046e5b8) ### Actual Behavior 1 row red, the following ones are already filled in correctly. ![image](https://github.com/user-attachments/assets/c6a546df-7180-42dc-bc87-ae02c5fa609d) maximize window. ![image](https://github.com/user-attachments/assets/c3d538be-81bf-496a-a59e-0a2f864a1f03) restoring the window and then maximizing it again fixes this error. ![image](https://github.com/user-attachments/assets/fbf3805c-f870-43f5-94f2-b4cf6c777067) but it doesn't help for a single row. ![image](https://github.com/user-attachments/assets/77ea6c47-b05d-4c55-8b31-475676100f4a) It is worth summing up. Attributes are filled into new buffer cells correctly when using Windows Console Api. When using virtual codes, the described problem is observed. Also in Windows Console (cmd.exe) any window scaling, in both Windows Api and virtual codes, causes attributes to be filled incorrectly. ![image](https://github.com/user-attachments/assets/883cedbe-d5cb-4c0b-ba97-57fa20d71826) ![image](https://github.com/user-attachments/assets/3d8fea85-d1cf-4536-b7bb-28028fd5e7cf) ![image](https://github.com/user-attachments/assets/2461d977-7791-47ff-bc1b-4d1af8ecea04) But this is known, and I understand that you are releasing all fixes in Windows Terminal.
claunia added the Area-OutputIssue-BugPriority-3Product-Conpty labels 2026-01-31 08:02:18 +00:00
Author
Owner

@2trvl commented on GitHub (Aug 6, 2024):

Windows Terminal Canary 1.22.2151.0
Console API Version: OK
Virtual codes: all new cells are marked with the background attribute set.

image
image

However, now if you reset the background attribute to the default state, the problem is not observed. In version 1.20.11781.0, even after resetting the attribute, a single red row appears.

image

@2trvl commented on GitHub (Aug 6, 2024): Windows Terminal Canary 1.22.2151.0 Console API Version: OK Virtual codes: all new cells are marked with the background attribute set. ![image](https://github.com/user-attachments/assets/5e5fd1ff-3b85-4d45-b29b-54a600554a3a) ![image](https://github.com/user-attachments/assets/3540defc-54c3-4204-a286-9a808feda38d) However, now if you reset the background attribute to the default state, the problem is not observed. In version 1.20.11781.0, even after resetting the attribute, a single red row appears. ![image](https://github.com/user-attachments/assets/c6a546df-7180-42dc-bc87-ae02c5fa609d)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22057