tmux : add tda to detach all other clients.

This commit is contained in:
Dmitry Voronin 2023-12-10 16:56:56 +03:00
parent 982e79e595
commit 922e61b482
2 changed files with 8 additions and 2 deletions

View file

@ -8,7 +8,7 @@ function ta() {
if [[ "$name" = "" ]]; then if [[ "$name" = "" ]]; then
name="main" name="main"
fi fi
# call tmux. # call tmux.
tmux new -s "$name" 2> /dev/null || tmux attach-session -t "$name" tmux new -s "$name" 2> /dev/null || tmux attach-session -t "$name"
} }
@ -18,6 +18,11 @@ function td() {
tmux detach-client tmux detach-client
} }
# Detach all other tmux clients.
function tda() {
tmux detach-client -a
}
# List running sessions. # List running sessions.
function tl() { function tl() {
tmux list-sessions tmux list-sessions
@ -51,7 +56,7 @@ function tk() {
if [[ "${1}" = "" ]]; then if [[ "${1}" = "" ]]; then
1="main" 1="main"
fi fi
# call tmux. # call tmux.
for name in "$@"; do for name in "$@"; do
tmux kill-session -t "${name}" tmux kill-session -t "${name}"

View file

@ -309,6 +309,7 @@ Command|Description
---|--- ---|---
`ta [NAME]`|Create/attach to named session. By default uses name `main`. `ta [NAME]`|Create/attach to named session. By default uses name `main`.
`td`|Detach from running session. `td`|Detach from running session.
`tda`|Detach all other tmux clients.
`tl`|List running sessions. `tl`|List running sessions.
`trn [NAME]`|Rename current session. Uses current dir name by default. `trn [NAME]`|Rename current session. Uses current dir name by default.
`tn [NAME]`|Assign name to window. Uses current dir name by default. `tn [NAME]`|Assign name to window. Uses current dir name by default.