Closed yzhou61 closed 2 years ago
You can probably script this.
I'm using a simple shell script ssht
to automatically attach or create a new tmux session on the target server
#!/usr/bin/env bash
ssh $* -t 'tmux attach || tmux'
Check how is this script program saved locally, and make sure it's restored via set -g @resurrect-processes
.
Thanks. That worked and is a pretty elegant solution.
Hi, I apologize if this has been addressed before. I have a tmux session on my local machine, with multiple windows of ssh sessions to different servers. Each server runs a tmux session on its own.
When I restore my local tmux, I get all the windows back, with restored ssh sessions, which is great. But it will be even better if the tmux session on the server is also restored. Basically I'm asking if a
tmux a
can be executed automatically upon ssh connection.Thanks.