-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Labels
Area-WindowingWindow frame, quake mode, tearoutWindow frame, quake mode, tearoutIn-PRThis issue has a related PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.The new Windows Terminal.
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
Area-WindowingWindow frame, quake mode, tearoutWindow frame, quake mode, tearoutIn-PRThis issue has a related PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.The new Windows Terminal.
Activity
github-actions commentedon May 2, 2024
zadjii-msft commentedon May 3, 2024
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.
lhecker commentedon May 13, 2024
I found that this tool can be used for shutdown tests:
For instance:
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 commentedon May 14, 2024
tl;dr: handoff doesn't assign a
SessionId
!I figured out how to reproduce multiple issues (probably even the issue):
persistedWindowLayouts
is non-emptySessionId
gets storedzadjii-msft commentedon May 15, 2024
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 🤷
12 remaining items
Fix session persistence when the session ends (microsoft#17714)
Fix session persistence when the session ends (#17714)
mmseng commentedon Oct 1, 2024
My understanding is that this shipped with v1.22. Today was the first time that my workstation performed Windows updates while having 1.22 installed, and Terminal successfully restored its state after logging back in, and also respected the change to show some of the restored history without scrolling up. Thanks!
working-name commentedon Apr 29, 2025
1.22.10731.0 - still doesn't restore windows if you close terminal, and then reboot the computer with a
shutdown -r -t 0
. Maybe Terminal needs a couple minutes to write the session file? Not sure what the issue might be.@lhecker Don't think this fix handles that ^
mmseng commentedon Apr 29, 2025
Tangentially, I noticed that my tabs/history in my Terminal Preview app didn't get persisted across the last couple of Windows updates. However I was traveling and accessing my usual remote workstation through a much smaller laptop screen and really wasn't paying close enough attention to what I had open when these updates restarted the workstation, so I'm not 100% sure exactly what happened.
Eagerly persist on WM_ENDSESSION (microsoft#18912)
Eagerly persist on WM_ENDSESSION (#18912)