12345678910111213141516171819202122232425262728293031 |
- #!/usr/bin/env bash
- if [[ -n $SSH_CLIENT ]]; then
- case $HOSTNAME in
- *.example.com) prompt_user_host_color='1;35';; # magenta on example.com
- *) prompt_user_host_color='1;33';; # yellow elsewhere
- esac
- else
- unset prompt_user_host_color;; # omitted on the local machine
- fi
- if [[ -n $prompt_user_host_color ]]; then
- PS1='\[\e['$prompt_user_host_color'm\]\u@\h'
- else
- PS1=
- fi
- PS1+='\[\e[1;34m\] \w\[\e[1;31m\]$(__git_ps1)\[\e[1;0;37m\] \$\[\e[0m\] '
- if [[ -n $SSH_CLIENT ]]; then
- case $HOSTNAME in
- *.example.com) prompt_user_host_color='1;35';; # magenta on example.com
- *) prompt_user_host_color='1;33';; # yellow elsewhere
- esac
- else
- unset prompt_user_host_color;; # omitted on the local machine
- fi
- if [[ -n $prompt_user_host_color ]]; then
- PS1='\[\e['$prompt_user_host_color'm\]\u@\h'
- else
- PS1=
- fi
- PS1+='\[\e[1;34m\] \w\[\e[1;31m\]$(__git_ps1)\[\e[1;0;37m\] \$\[\e[0m\] '
|