Skip to content

Instantly share code, notes, and snippets.

@syphoxy
Last active August 29, 2015 14:00
Show Gist options
  • Save syphoxy/a159ec274d41e5a7db24 to your computer and use it in GitHub Desktop.
Save syphoxy/a159ec274d41e5a7db24 to your computer and use it in GitHub Desktop.
show machine name in zsh prompt if connected through ssh
function precmd {
local SSH_STATUS=""
if [ -n "$SSH_CONNECTION" ]
then
SSH_STATUS="%m "
fi
PROMPT="${SSH_STATUS}%1~ %B%#%b "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment