diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-15 15:54:28 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-16 22:04:29 -0700 |
commit | 4c315e05fb1c21e34d5c0e9df13a8d3e250cd711 (patch) | |
tree | c0847a445c58bfb117e9be52e760a3850c246528 | |
parent | 3901a5bdfb446b1ebc52deab8451ded49f5972df (diff) | |
download | dotfiles-4c315e05fb1c21e34d5c0e9df13a8d3e250cd711.tar.gz |
ssh-and-tmux: tweak (re-)connection prompting
-rwxr-xr-x | bin/ssh-and-tmux | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ssh-and-tmux b/bin/ssh-and-tmux index 3f25f43c..5b8aa7a1 100755 --- a/bin/ssh-and-tmux +++ b/bin/ssh-and-tmux @@ -83,13 +83,15 @@ else # We now die when ssh exits zero, so this feature may be obsolete. echo -ne "\033]0;tmux $session on $display_host\007" - prompt="Press any key to (re-)connect to tmux session [1m$session[0m" - prompt+=" on [1m$display_host[0m; d/C-d/C-c to give up .." + prompt="Press any key to retry tmux [1m$session[0m" + prompt+=" on [1m$display_host[0m; + d/C-d/C-c to give up .. " while true; do ssh -t "$host" "${cmd[*]}" && exit clear read -n 1 -r -s -p "$prompt" ch + clear [ "$ch" = $'\04' -o "$ch" = d ] && echo && exit done fi |