diff options
author | Stefan Kreutz <mail@skreutz.com> | 2022-05-23 23:23:22 +0200 |
---|---|---|
committer | Stefan Kreutz <mail@skreutz.com> | 2022-05-23 23:23:22 +0200 |
commit | 43c51a845c6fa159e41782301441f38241c349ed (patch) | |
tree | 2ea1394332de3837e18e3af363443981730e0864 | |
parent | 0d4b20e9226f60fdc0fc03d8b38a00d267d5b40e (diff) | |
download | ssh-tmux-43c51a845c6fa159e41782301441f38241c349ed.tar |
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | ssh-tmux.1 | 11 |
2 files changed, 13 insertions, 10 deletions
@@ -8,17 +8,15 @@ with the ability to re-connect. ## Usage -The following command logs into the OpenSSH host `example.com`, creates and -attaches to a new Tmux session named `make`, and builds a project. +Build a project in a new Tmux session on a remote OpenSSH host: - $ ssh-tmux -s make example.com "cd project && make && sudo make install" + $ ssh-tmux example.com "cd project && make && sudo make install" -When you detach or disconnect, or simply want to watch from another client, you -can re-connect and re-attach as follows: +Connect and attach from another client or after disconnection: - $ ssh -t example.com tmux attach-session -t make + $ ssh -t example.com "tmux attach-session \; choose-tree" -See the manual page for more examples. +See the manual page for details and more examples. ## Installation @@ -63,12 +63,12 @@ Execute a possibly long-running interactive remote command: $ ssh-tmux example.com "cd project && make && doas make install" .Ed .Pp -A command with local and remote shell expansion: +Connect and attach from another client or after disconnection: .Bd -literal -offset indent -$ ssh-tmux example.com echo $HOST \e$HOST +$ ssh -t example.com "tmux attach-session \e; choose-tree" .Ed .Pp -Detach and re-attach session: +Detach and re-attach a named session: .Bd -literal -offset indent $ ssh-tmux -d -s monitor example.com top $ ssh -t example.com tmux attach-session -t monitor @@ -79,6 +79,11 @@ Move window to another session: $ ssh-tmux -d -s monitor -n top example.com top $ ssh -t example.com "tmux new-session -A -s mysession \e; move-window -s monitor:top" .Ed +.Pp +A command with local and remote shell expansion: +.Bd -literal -offset indent +$ ssh-tmux example.com echo $HOST \e$HOST +.Ed .Sh SEE ALSO .Xr nohup 1 , .Xr ssh 1 , |