[bash] add user & host to prompt string
The color of the user and host changes when the session takes place over SSH. This makes it easier to identify to which machine a terminal is connected.
This commit is contained in:
parent
43de18855f
commit
1fd8816784
1 changed files with 3 additions and 8 deletions
11
bash_profile
11
bash_profile
|
@ -133,14 +133,9 @@ do_solarize_shell() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Customize the prompt
|
# Customize the prompt
|
||||||
if [ "$BACKGROUND" = "light" ]; then
|
[ -n "$SSH_CLIENT" ] && __c="0;33" || __c="0;36"
|
||||||
prompt_color="\[\033[0;36m\]" # cyan
|
export PS1="\n[\[\033[${__c}m\]\u@\h \[\033[0;34m\]\w\[\033[0m\]]\n$(__git_ps1 '%s ')\$ "
|
||||||
else
|
export PS2=". "
|
||||||
prompt_color="\[\033[0;34m\]" # blue
|
|
||||||
fi
|
|
||||||
git_prompt='$(__git_ps1 "%s ")'
|
|
||||||
export PS1="\n[${prompt_color}\w\[\033[0m\]]\n${git_prompt}\$ ";
|
|
||||||
export PS2=". ";
|
|
||||||
|
|
||||||
# Customize colors for `ls` command
|
# Customize colors for `ls` command
|
||||||
ls_colors="$HOME/.dircolors/solarized-$BACKGROUND"
|
ls_colors="$HOME/.dircolors/solarized-$BACKGROUND"
|
||||||
|
|
Loading…
Add table
Reference in a new issue