I am using multiple tabs with "screen" in bash and I have setup the following to rename the tab to the target hostname if I ssh in that tab:
$HOME/.ssh_hostname
#!/bin/sh
echo -ne "\033k$1\033\\"
$HOME/.ssh/config
PermitLocalCommand yes
LocalCommand ~/.ssh_hostname %h
This works great, but the one thing I'd like to do is rename it back to "default" when I exit the ssh session. Right now it just keeps the tab renamed even if I exit ssh.
Any ideas about how I could re-rename it when I exit ssh?