This is the quick way to set window name to hostname connected to. printf "\033k`hostname -s`\033\\" See superuser.com bash tmux