put ssh host as window name in tmux

This commit is contained in:
David Aizenberg
2022-07-27 01:39:17 +01:00
parent 3df02610d6
commit 6961eb3613

3
.zshrc
View File

@@ -47,7 +47,8 @@ function fzf-ssh () {
local selected_host=$(grep "Host " ~/.ssh/config | grep -v '*' | cut -b 6- | fzf --query "$LBUFFER" --prompt="SSH Remote > ") local selected_host=$(grep "Host " ~/.ssh/config | grep -v '*' | cut -b 6- | fzf --query "$LBUFFER" --prompt="SSH Remote > ")
if [ -n "$selected_host" ]; then if [ -n "$selected_host" ]; then
BUFFER="ssh ${selected_host}" tmux rename-window "Remote -- $selected_host"
BUFFER="ssh ${selected_host} ; tmux rename-window dc"
zle accept-line zle accept-line
fi fi
zle reset-prompt zle reset-prompt