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

Preserve WT_SESSION across restarts #6362

Closed
davidchisnall opened this issue Jun 5, 2020 · 6 comments
Closed

Preserve WT_SESSION across restarts #6362

davidchisnall opened this issue Jun 5, 2020 · 6 comments
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@davidchisnall
Copy link

The macOS terminal (and iTerm, I believe) provide an environment variable analogous to WT_SESSION that is preserved across application restarts. When the terminal restarts, it will recreate all of the windows and tabs in their original position and with the same working directory.

I use this feature to preserve ssh sessions across restarts. I use a shell function to wrap ssh. This function creates a file in a specific location whose name is the terminal session ID and whose contents is the connection string. It then starts a tmux session on the remote end whose session ID is the terminal session ID. In .bashrc, I check whether a file exists describing the current session and, if so, automatically reconnect.

When I install software updates on my Mac, the terminal is killed and all of my remote connections resume after the reboot. A Windows update was forcibly installed last night causing WT to exit and I lost all of my existing connections and spent 10 minutes this morning restoring the state for my working environment.

@davidchisnall davidchisnall added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jun 5, 2020
@ghost ghost added 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 Jun 5, 2020
@zadjii-msft
Copy link
Member

This is actually really clever. I've never heard of doing anything like that so that seems like a really cool idea. We'll track this as a sub-point in #961

@zadjii-msft zadjii-msft added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jun 5, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 5, 2020
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 5, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jun 5, 2020
@davidchisnall
Copy link
Author

Ah, sorry. I searched for WT_SESSION and read the related bugs, but didn't see #961.

@paveldvorak5
Copy link

It would be a cool feature. I hate restoring lost terminal tabs after reboot.

@zadjii-msft
Copy link
Member

@lhecker sanity check me - we do this now, right?

image

@zadjii-msft zadjii-msft modified the milestones: Backlog, Terminal v1.21 Apr 16, 2024
@davidchisnall
Copy link
Author

I no longer run Windows, so can't confirm, feel free to close.

@lhecker
Copy link
Member

lhecker commented Apr 16, 2024

@zadjii-msft Yup this should work now.

@lhecker lhecker closed this as completed Apr 16, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants