Skip to content

Instantly share code, notes, and snippets.

@thomascharbonnel
Last active October 19, 2021 07:42
Show Gist options
  • Save thomascharbonnel/7fe3c1c26c6bad1d7758d1f5f6e18f76 to your computer and use it in GitHub Desktop.
Save thomascharbonnel/7fe3c1c26c6bad1d7758d1f5f6e18f76 to your computer and use it in GitHub Desktop.
Set tmux pane title to short hostname on ssh connections for Fish
# Copy that into your ~/.config/fish/config.fish
function ssh
set ps_res (ps -p (ps -p %self -o ppid= | xargs) -o comm=)
if [ "$ps_res" = "tmux" ]
tmux rename-window (echo $argv | cut -d . -f 1)
command ssh "$argv"
tmux set-window-option automatic-rename "on" 1>/dev/null
else
command ssh "$argv"
end
end
@nippyin
Copy link

nippyin commented Aug 3, 2021

Thanks it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment