-
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
Preserve WT_SESSION across restarts #6362
Comments
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 |
Ah, sorry. I searched for WT_SESSION and read the related bugs, but didn't see #961. |
It would be a cool feature. I hate restoring lost terminal tabs after reboot. |
@lhecker sanity check me - we do this now, right? |
I no longer run Windows, so can't confirm, feel free to close. |
@zadjii-msft Yup this should work now. |
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.
The text was updated successfully, but these errors were encountered: