-
Notifications
You must be signed in to change notification settings - Fork 277
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
Allow session detach & re-attach over long periods of time #1701
Comments
We do allow this, but only over a few hours, not the next day. The reason is that the remote terminals and extensions can take up a lot of resources, and we don't know for sure whether you are done with them or not. You might consider using tmux to persist your terminal sessions on the remote outside of vscode, this is what I do. |
@roblourens I don't see this happening even if I disconnect and immediately re-connect |
can vs-code not provide an explicit option to detach and re-attach to the session ? |
If you explicitly disconnect (by closing the window or running the disconnect command or something) then your session on the other side will not be preserved. I don't want to make this a feature request for explictly preserving sessions because I think the only place in the remote EH where state really matters is in terminals, and there are already tools that do a good job with this. |
Can you please share which ones work the best and how to configure VSCode terminal to use them? Also, terminal is not the only stateful feature of VSCode: sometimes I start a long-running process under a debugger, and disconnecting kills debug sessions. |
I am thinking of tmux. I guess I can leave this open as a feature request, it might be nice to have a session manager and let the user explicitly persist and reattach to sessions. |
@roblourens In my use-case I don't care about using server resources, but really want to avoid long "Setting up SSH remote" wait times, and ideally avoid "Could not establish connection" prompts when the connection breaks. Can tmux help with this? If so what does configuring it for VS Code look like? I tried using |
You can set up tmux so your terminal sessions will be persisted across connections, but vscode will still have to reconnect. |
@roblourens Connecting / reconnecting to a remote server with vscode takes a long time relative to either open a local project in vscode, or connecting to a server with ssh. Can something be done to help this? |
You can enable It's enabled by default in the nightly version of the extension. |
I am having the same issue. Leaving the editor for a couple of hours will reset my workspace. The interesting part is that it will keep the Ruby on Rails server running + Webpack development server, so I have to go in kill the old processes before I can start them up again. While it is possible to do so, it is very cumbersome (especially because I have to do it multiple times per day). The machines I am using are dedicated development servers with i9 CPU's and 64 GB RAM, so leaving the processes hanging aren't really an issue at all. Also all the development environments are running in Docker containers that the individual developer can restart to make a total reset if he/she desires to. It would be greatly appreciated if we could configure VSCode to use a much longer timeout or to not kill the sessions at all. |
I connect to a physical linux host using vscode remote ssh.
I end up opening a bunch of terminals in vscode.
When I leave disconnect from the network / leave for the day, my terminal contents are completely lost. I have to restart all the processes.
Would it be possible to leave the remote session running along with it's terminal processes even if the client is disconnected.
When the client reconnects, just re-attach to the terminals that were started previously
Thanks!
The text was updated successfully, but these errors were encountered: