Setting GNU Screen title to SSH hostname

Adapted from: https://m0dlx.com/blog/Renaming_GNU_Screen_windows_by_SSH_remote_hostname.html

Create ~/.ssh_hostname and chmod +x:

#!/bin/bash
echo -ne "\033k$1\033\\"

And then add to ~/.ssh/config:

PermitLocalCommand yes
LocalCommand ~/.ssh_hostname %h

This interferes with Git SSH commands, so be sure to exclude those hosts, for example:

Host * !bitbucket.org
PermitLocalCommand yes
LocalCommand ~/.ssh_hostname %h