Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code: Persistent R or Python sessions over SSH

I work with R and Python remotely over SSH using VS Code.

I sometimes want to retain R/Python variables in memory even after I disconnect from the server, and pick up the same R/Python sessions where I left off the day before.

Is there any way I could achieve this using VS Code?

The remote server is running Linux (Ubuntu).

like image 385
gaspanic Avatar asked Jul 21 '26 23:07

gaspanic


1 Answers

The only way I've been able to figure out how to do this is to first open a tmux terminal and then start R from within the tmux terminal.

Install tmux on the server, then you can open a bash terminal from within vscode and type tmux new -s SESSION_NAME Then from within that tmux session type R Now when you want to close your laptop but keep whatever running on the server, close the tmux window with the keystroke Ctl+b then d. Now when you want to access the session again you open a bash terminal and type tmux a -t SESSION_NAME and then you're right back where you left off

like image 184
Avery H Avatar answered Jul 23 '26 17:07

Avery H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!