Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes windows don't get persisted on a Windows Update #17179

Open
zadjii-msft opened this issue May 2, 2024 · 5 comments
Open

Sometimes windows don't get persisted on a Windows Update #17179

zadjii-msft opened this issue May 2, 2024 · 5 comments
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.

Comments

@zadjii-msft
Copy link
Member

v1.21

I've now had a couple days where I've gotten a Windows Update, and came back to the Terminal not quite in the right state as before:

  • A few times, I've had the buffer restored, but to a previous day's state. As if the buffer didn't get persisted on shutdown, but on launch I did get the buffer from the previous shutdown.
  • Today, I only had one of my two windows persisted across the reboot. The window that was persisted did have all it's buffers restored, but the other window was gone entirely.

I have a theory that this is somehow related to us not handling WM_ENDSESSION post-PMv3 quite right, but that's a guess, not a root cause.

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels May 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 2, 2024

This comment was marked as off-topic.

@zadjii-msft
Copy link
Member Author

Yea, again today, I got both windows back, but the buffer state was what it was the previous time I had quit the Terminal. So, whatever happened during the update meant that the Terminal didn't actually persist the buffer.

@carlos-zamora carlos-zamora added this to the Terminal v1.22 milestone May 8, 2024
@carlos-zamora carlos-zamora added Area-Windowing Window frame, quake mode, tearout and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 8, 2024
@lhecker
Copy link
Member

lhecker commented May 13, 2024

I found that this tool can be used for shutdown tests:

C:\Program Files (x86)\Windows Kits\10\App Certification Kit\rmlogotest.exe

For instance:

& "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\rmlogotest.exe" (ps -Name WindowsTerminal).Id

I couldn't reproduce any issues on the main branch, even with multiple windows that have multiple tabs, and no matter how I re-launched the app.

@lhecker
Copy link
Member

lhecker commented May 14, 2024

tl;dr: handoff doesn't assign a SessionId!

I figured out how to reproduce multiple issues (probably even the issue):

  • Launch
  • (Register that version of WT as the default)
  • Close all tabs (Ctrl+Shift+W)
  • Bug: persistedWindowLayouts is non-empty
  • Launch cmd/pwsh via handoff, but use the one that's not your default profile
  • (Known) Bug: You got 2 windows now instead of 1 (this is a consequence of the previous bug)
  • Close the tab with the default profile (= the extra window)
  • Close window with the handoff'd non-default profile (= press red X)
  • Bug: Buffer doesn't get persisted, and no SessionId gets stored

@zadjii-msft
Copy link
Member Author

So yea here's the thing - defterm wasn't involved (to the best of my knowledge) in my scenario. I almost never open things via defterm anymore - pretty sure Stable is set as my defterm handler. Normally quitting the terminal will persist just fine - there's something specific about updates that makes the terminal not persist the current state of the buffer 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants