-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Version: 1.20.10572.0 reopens last tabs whenever it feels like it #17250
Comments
Please adhere to this repository’s Code of Conduct when you are reporting issues. |
Sure thing. Was it "d***" that upset you? |
"damn" is not a problem, your post is simply just too sarcastic. For what reason? I'd understand it if we had done something to offend you, but it's just a bug in the application. In any case, we're already aware about this issue and still collecting information when and why it happens. It's likely a race condition during shutdown or something similar, which is why it seems "random". My current theory is that it only happens if you have more than one window open. |
Got it. Your current theory matches what I experienced about a year ago (don't remember version) when I curbed my behavior to have more than 1 terminal window open before I close it. So this bug also happens when a single window with multiple tabs is open. I think I made it happen once or twice when I was trying to reproduce it by killing the process from Process Hacker. |
If I were to posit a theory: I'm guessing you've got some other CLI process that starts at startup. The OS starts that process up, and it picks Terminal as the default terminal handler, and starts the Terminal. Then, when the Terminal starts, it also starts up all the other windows for itself. Now I'm guessing that the reason why sometimes this doesn't happen is along the lines of #17179 - sometimes, the window state isn't getting persisted if you just straight shutdown the PC. |
Once all applications that have received a `WM_ENDSESSION` message have returned from processing said message, windows will terminate all processes. This forces us to process the message synchronously. This meant that this issue was timing dependent. If Windows Terminal was quick at persisting buffers and you had some other application that was slow to shut down (e.g. Steam), you would never see this issue. Closes #17179 Closes #17250 ## Validation Steps Performed * Set up a lean Hyper-V VM for fast reboots * `Set-VMComPort <vm> 1 \\.pipe\\<pipe>` * Hook up WIL to write to COM1 * Add a ton of debug prints all over the place * Read COM output with Putty for hours * RTFM, and notice that the `WM_ENDSESSION` documentation states "the session can end any time after all applications have returned from processing this message" * Be very very sad ✅ * Fix it * Rebooting now shows on COM1 that persistence runs ✅ * Windows get restored after reboot ✅ (cherry picked from commit b439925) Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCik Service-Version: 1.21
Windows Terminal version
Version: 1.20.10572.0
Windows build number
Version 10.0.22631 Build 22631
Other Software
No response
Steps to reproduce
Open terminal preview.
Open several tabs.
Restart computer either before or after you close down Terminal.
Wonder if it'll restore windows or it won't.
Expected Behavior
Do what the option says: reopen tabs from last session.
Actual Behavior
randomly opens last session tabs whenever it feels like it. No option to save my own and restore manually, I'm just living at the mercy of my own (removed expletive to comply with Code of Conduct) computer. It's great.
The text was updated successfully, but these errors were encountered: