Synchronized terminal renderers causes text buffer corruption #10899

Closed
opened 2026-01-31 02:33:14 +00:00 by claunia · 3 comments
Owner

Originally created by @javierdlg on GitHub (Oct 5, 2020).

Environment

Windows build number: (2004) 19041.508
Windows Terminal version (if applicable): Latest Master

Any other software?
Visual Studio 2019

Steps to reproduce

  1. Install the attached Terminal and UseTerm extensions to Visual Studio 2019:
    http://gofile.me/6Ji0B/gkt4dnnxa

  2. Open VS

  3. Activate repro command under Tools -> New Terminal
    This will open two terminal windows Main Terminal and Secondary Terminal. Wait for them to initialize before continuing.

  4. Undock and resize Main Terminal tool window to a smaller terminal size than Secondary Terminal tool window like so:
    image

  5. Write dir or any other commands into Main Terminal that output large amounts of text and lines (wrong commands also work like asdf)

Expected behavior

Both terminals are kept in sync and content is displayed correctly

Actual behavior

Secondary Terminal suffers from text buffer corruption that makes certain lines invisible until you force the text buffer to update for those characters.

Testing a Fix

If you'd like to patch a new Terminal.WPF.dll or PublicTerminalCore.dll files, you can find them under %localappdata%\Microsoft\VisualStudio\16.0_<instance_ID>\Extensions\<ExtensionID>

Originally created by @javierdlg on GitHub (Oct 5, 2020). # Environment ```none Windows build number: (2004) 19041.508 Windows Terminal version (if applicable): Latest Master Any other software? Visual Studio 2019 ``` # Steps to reproduce 1. Install the attached Terminal and UseTerm extensions to Visual Studio 2019: http://gofile.me/6Ji0B/gkt4dnnxa 2. Open VS 3. Activate repro command under Tools -> New Terminal This will open two terminal windows `Main Terminal` and `Secondary Terminal`. Wait for them to initialize before continuing. 4. Undock and resize `Main Terminal` tool window to a smaller terminal size than `Secondary Terminal` tool window like so: ![image](https://user-images.githubusercontent.com/2334756/95132825-3cc23400-0715-11eb-87b9-75f4ee5a71c3.png) 5. Write `dir` or any other commands into `Main Terminal` that output large amounts of text and lines (wrong commands also work like `asdf`) # Expected behavior Both terminals are kept in sync and content is displayed correctly # Actual behavior `Secondary Terminal` suffers from text buffer corruption that makes certain lines invisible until you force the text buffer to update for those characters. # Testing a Fix If you'd like to patch a new Terminal.WPF.dll or PublicTerminalCore.dll files, you can find them under `%localappdata%\Microsoft\VisualStudio\16.0_<instance_ID>\Extensions\<ExtensionID>`
claunia added the Resolution-By-DesignNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 02:33:14 +00:00
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

Judging by the repro here, it looks like the backing console (conhost) is being resized, but the secondary terminal is never being told about it.

Just so we're clear: conhost in PTY mode was not designed to have two heads visible at the same time. You'll need to communicate any viewport changes to all connected terminals yourself, if at all possible.

@DHowett commented on GitHub (Oct 5, 2020): Judging by the repro here, it looks like the backing console (conhost) is being resized, but the secondary terminal is never being told about it. Just so we're clear: _conhost in PTY mode was not designed to have two heads visible at the same time_. You'll need to communicate any viewport changes to all connected terminals yourself, if at all possible.
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

This is, at its heart, the same thing that happens when an application resizes the console's backing buffer without telling Windows Terminal.

@DHowett commented on GitHub (Oct 5, 2020): This is, at its heart, the same thing that happens when an application resizes the console's backing buffer without telling Windows Terminal.
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

One last point of note: no PTY was designed to have two heads visible at the same time. This is uncommon enough that coordination is required between all hosts. Screen/tmux handle this well, but they handle it themselves.

Closing as by design for now.

@DHowett commented on GitHub (Oct 5, 2020): One last point of note: _no PTY was designed to have two heads visible at the same time_. This is uncommon enough that coordination is required between all hosts. Screen/tmux handle this well, but they handle it _themselves_. Closing as by design for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10899