microsoft / microsoft/terminal

Background color attribute is filled incorrectly when resizing window

Open
#17,671 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Output Issue-Bug Priority-3 Product-Conpty
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the supplied Python Virtual Terminal Sequences, changing the background and resizing or maximizing the Windows Terminal window. Compare behavior with the Windows Console API and cmd.exe cases described in the report. Done means newly created or resized buffer cells retain the expected background attribute for both single-row and larger resizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.