summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2022-05-23 23:23:22 +0200
committerStefan Kreutz <mail@skreutz.com>2022-05-23 23:23:22 +0200
commit43c51a845c6fa159e41782301441f38241c349ed (patch)
tree2ea1394332de3837e18e3af363443981730e0864
parent0d4b20e9226f60fdc0fc03d8b38a00d267d5b40e (diff)
downloadssh-tmux-main.tar
Describe interactive attach using choose-treeHEADmain
-rw-r--r--README.md12
-rw-r--r--ssh-tmux.111
2 files changed, 13 insertions, 10 deletions
diff --git a/README.md b/README.md
index 0cd0938..1aba27a 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/ssh-tmux.1 b/ssh-tmux.1
index 590d9eb..40863b0 100644
--- a/ssh-tmux.1
+++ b/ssh-tmux.1
@@ -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 ,
Generated by cgit. See skreutz.com for my tech blog and contact information.