Content and history of a terminal tab is lost when DPI of the system/display changes. #12226

Closed
opened 2026-01-31 03:09:34 +00:00 by claunia · 12 comments
Owner

Originally created by @michkot on GitHub (Jan 27, 2021).

Environment

Windows build number: 10.0.18363.1256
Windows Terminal version : 1.4.3243.0

Steps to reproduce

Have a running WT instance with output in it.
Disconnect/connect a display (where different displays have differently set DPIs), which triggers "desktop reconfiguration".
Focus the WT window.

Expected behavior

You will see a (now DPI-rescaled) WT windows with an active tab with the previous content and you can scroll to history.

Actual behavior

There is no content in the tab, you don't see newly rendered content. You have to resize the WT window to resume functionality, but the last content is lost and so is the scroll history for that tab!

Originally created by @michkot on GitHub (Jan 27, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18363.1256 Windows Terminal version : 1.4.3243.0 ``` # Steps to reproduce Have a running WT instance with output in it. Disconnect/connect a display (where different displays have differently set DPIs), which triggers "desktop reconfiguration". Focus the WT window. # Expected behavior You will see a (now DPI-rescaled) WT windows with an active tab with the previous content and you can scroll to history. # Actual behavior There is no content in the tab, you don't see newly rendered content. You have to resize the WT window to resume functionality, but the last content is lost and so is the scroll history for that tab!
Author
Owner

@zadjii-msft commented on GitHub (Jan 27, 2021):

This is bizarre. I dock and undock my laptop a few times a day, and never have any issues with this.

What graphics card are you using?

If you just try and type some input into the terminal instead of resizing when this occurs, what happens?

I've never heard of anything like this so I'm totally grasping at straws. Especially the

but the last content is lost and so is the scroll history for that tab!

That seems to imply that the entire buffer was resized to some ungodly small or large size, such that the entire buffer cycled. Does the scrollbar stay in the same place, with just empty content above it? Or does the scrollbar reset to the top?

@zadjii-msft commented on GitHub (Jan 27, 2021): This is bizarre. I dock and undock my laptop a few times a day, and never have any issues with this. What graphics card are you using? If you just try and type some input into the terminal instead of resizing when this occurs, what happens? I've never heard of anything like this so I'm totally grasping at straws. Especially the > but the last content is lost and so is the scroll history for that tab! That seems to imply that the entire buffer was resized to some ungodly small or large size, such that the entire buffer cycled. Does the scrollbar stay in the same place, with just empty content above it? Or does the scrollbar reset to the top?
Author
Owner

@ghost commented on GitHub (Jan 31, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jan 31, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@michkot commented on GitHub (Feb 2, 2021):

This is bizarre. I dock and undock my laptop a few times a day, and never have any issues with this.

What graphics card are you using?

It's Quadro T1000 with Optimus disabled (no active iGPU)

If you just try and type some input into the terminal instead of resizing when this occurs, what happens?

I don't see anything (I assume I just don't see the input being echoed by the shell)

I've never heard of anything like this so I'm totally grasping at straws. Especially the

but the last content is lost and so is the scroll history for that tab!

That seems to imply that the entire buffer was resized to some ungodly small or large size, such that the entire buffer cycled. Does the scrollbar stay in the same place, with just empty content above it? Or does the scrollbar reset to the top?
I think the scrollbar completely disappeared, as if the buffer would fit a single screen.

I have just docked my computer before a while (and tried again now) and it did not happen. What would be the best way to capture info if this happens again?

@michkot commented on GitHub (Feb 2, 2021): > This is bizarre. I dock and undock my laptop a few times a day, and never have any issues with this. > > What graphics card are you using? It's Quadro T1000 with Optimus disabled (no active iGPU) > If you just try and type some input into the terminal instead of resizing when this occurs, what happens? I don't see anything (I assume I just don't see the input being echoed by the shell) > I've never heard of anything like this so I'm totally grasping at straws. Especially the > > > but the last content is lost and so is the scroll history for that tab! > > That seems to imply that the entire buffer was resized to some ungodly small or large size, such that the entire buffer cycled. Does the scrollbar stay in the same place, with just empty content above it? Or does the scrollbar reset to the top? I think the scrollbar completely disappeared, as if the buffer would fit a single screen. I have just docked my computer before a while (and tried again now) and it did not happen. What would be the best way to capture info if this happens again?
Author
Owner

@zadjii-msft commented on GitHub (Feb 2, 2021):

You know, I'm not sure. This is one of those bugs where once it's happened, it's too late to get any more useful info - the interesting event is already lost.

Does it happen in every shell? Or is the problem specific to cmd/powershell? Again, grasping at straws.

@zadjii-msft commented on GitHub (Feb 2, 2021): You know, I'm not sure. This is one of those bugs where once it's happened, it's too late to get any more useful info - the interesting event is already lost. Does it happen in every shell? Or is the problem specific to `cmd`/`powershell`? Again, grasping at straws.
Author
Owner

@michkot commented on GitHub (Feb 4, 2021):

I am actually using almost exclusively msys2 bash, which feels like a red
flag to write . I could try keeping an open window with cmd for comparison,
if the problem might be application specific.

@michkot commented on GitHub (Feb 4, 2021): I am actually using almost exclusively msys2 bash, which feels like a red flag to write . I could try keeping an open window with cmd for comparison, if the problem might be application specific.
Author
Owner

@michkot commented on GitHub (Mar 16, 2021):

Something similar happened today (with msys2 bash) with Version: 1.6.10571.0
However this time, the terminal is display new input without problem (jus the old buffer was lost)
Other two terminals tabs are fine (there was just this "jumpy" effect when switching to the tab first time after the DPI change - the text resizes inside the active tab)
I make a mini and full dump of the process using procexp + made a video of it the empty buffer, is that of any use?

@michkot commented on GitHub (Mar 16, 2021): Something similar happened today (with msys2 bash) with Version: 1.6.10571.0 However this time, the terminal is display new input without problem (jus the old buffer was lost) Other two terminals tabs are fine (there was just this "jumpy" effect when switching to the tab first time after the DPI change - the text resizes inside the active tab) I make a mini and full dump of the process using procexp + made a video of it the empty buffer, is that of any use?
Author
Owner

@zadjii-msft commented on GitHub (Mar 17, 2021):

That might help, yea. Maybe there's a needle in that haystack that could be informative

@zadjii-msft commented on GitHub (Mar 17, 2021): That might help, yea. Maybe there's a needle in that haystack that could be informative
Author
Owner

@ghost commented on GitHub (Mar 21, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Mar 21, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@michkot commented on GitHub (Mar 29, 2021):

@zadjii-msft Sorry, I was out, so I missed the bot deadlines. Is there some secure storage for uploading the dumps, so I don't have to leave them "accessible to anyone seeing this repo" in case some sensitive data is in the buffers? I took the dumps, but forgot to ask that question...

@michkot commented on GitHub (Mar 29, 2021): @zadjii-msft Sorry, I was out, so I missed the bot deadlines. Is there some secure storage for uploading the dumps, so I don't have to leave them "accessible to anyone seeing this repo" in case some sensitive data is in the buffers? I took the dumps, but forgot to ask that question...
Author
Owner

@michkot commented on GitHub (Sep 26, 2021):

So today it happened more or less again - after hibernating, disconnecting displays, starting pc again, the WT buffers "froze; I could see the latest content of my (2) tabs, until I tried to add any input or scroll in them -> after that, both of the tabs went blank, and now I can't see the history; When I write something, the tab works; when I try to scroll, the tab goes black, until I write something again - then the last screen content appears - this repeats (if I try to scroll again, -> black, write something -> current content).

Also my question regarding a private way to share a dump file with you is still valid :)

@michkot commented on GitHub (Sep 26, 2021): So today it happened more or less again - after hibernating, disconnecting displays, starting pc again, the WT buffers "froze; I could see the latest content of my (2) tabs, until I tried to add any input or scroll in them -> after that, both of the tabs went blank, and now I can't see the history; When I write something, the tab works; when I try to scroll, the tab goes black, until I write something again - then the last screen content appears - this repeats (if I try to scroll again, -> black, write something -> current content). Also my question regarding a private way to share a dump file with you is still valid :)
Author
Owner

@zadjii-msft commented on GitHub (Oct 26, 2022):

Hey we've made a lot of renderer changes in the last few months. Does this still repro on 1.15/1.16/?

@zadjii-msft commented on GitHub (Oct 26, 2022): Hey we've made a _lot_ of renderer changes in the last few months. Does this still repro on 1.15/1.16/?
Author
Owner

@ghost commented on GitHub (Oct 30, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Oct 30, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12226