-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
"Open windows from a previous session" not working due to session not being saved at exit #18525
Comments
Comparing the behavior to how the release version of Windows Terminal works, it looks like something is preventing persistedWindowLayouts in state.json from being populated. When I close Windows Terminal with multiple tabs open, state.json looks like this: {
"dismissedMessages" :
[
"closeOnExitInfo"
],
"generatedProfiles" :
[
"{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
"{d8e96812-b789-5068-a5ae-10b2fb53e95f}",
"{963ff2f7-6aed-5ce3-9d91-90d99571f53a}",
"{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"{bc2da056-dd06-5879-b969-1dfcefc8d2c7}",
"{47302f9c-1ac4-566c-aa3e-8cf29889d6ab}",
"{b453ae62-4e3d-5e58-b989-0a998ec441b8}"
],
"persistedWindowLayouts" :
[
{
"initialPosition" : "104,104",
"initialSize" :
{
"height" : 852,
"width" : 1517
},
"launchMode" : "default",
"tabLayout" :
[
{
"action" : "newTab",
"commandline" : "\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\"",
"profile" : "PowerShell",
"sessionId" : "{redacted}",
"startingDirectory" : "C:\\Users\\Username",
"suppressApplicationTitle" : false,
"tabTitle" : "PowerShell"
},
{
"action" : "newTab",
"commandline" : "ubuntu2404.exe",
"profile" : "Ubuntu 24.04.1 LTS",
"sessionId" : "{redacted}",
"startingDirectory" : null,
"suppressApplicationTitle" : false,
"tabTitle" : "Ubuntu 24.04.1 LTS"
},
{
"action" : "switchToTab",
"index" : 0
}
]
}
],
"settingsHash" : "{redacted}"
} When I do the same with either Preview or Canary, the saved state.json looks like this: {
"persistedWindowLayouts" : [],
"settingsHash" : "{redacted}"
} |
I implemented "Close all windows" as closing all windows. When persistence is enabled, it should turn into shutting down the application immediately after showing the dialog. To work around this, you can open the command palette (Ctrl+Shift+P) and type "quit" ("Quit the terminal"). |
(FWIW: we'll fix this!) |
As a more comfortable workaround, I tried to add a keyboard shortcut to the action "Quit the Terminal". This didn't work; the terminal didn't quit. This may be related. |
I'm not sure if I have the same exact issue, but only some of my panes get saved. It seems ones created by duplicating (alt+shift+enter) are not saved. |
Windows Terminal version
1.23.10353.0 (Preview) / 1.24.352.0 (Canary
Windows build number
Other Software
No response
Steps to reproduce
Expected Behavior
Previously opened tabs/windows are restored, including previous session history for each
Actual Behavior
Windows Terminal opens a single window with a single tab and launches a new instance of my default profile without any session history from the previous instance.
The text was updated successfully, but these errors were encountered: