1
0
Fork 0

[tmux] Switch client session if it already exists, otherwise attach

main
Sebastian Schulze 2022-06-16 13:20:57 +02:00
parent 7a9eaab91d
commit 6c205561d8
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
1 changed files with 5 additions and 1 deletions

View File

@ -14,4 +14,8 @@ if ! tmux has-session -t "${name}" 2> /dev/null; then
tmux select-window -t "${name}" -t 0
fi;
tmux attach -t "${name}"
if [[ -z "${TMUX} ]]; then
tmux attach -t "${name}"
else
tmux switch-client -t "${name}"
fi;