update bash prompt
- bring in sync with taken from https://github.com/kremalicious/dotfiles/blob/master/bash_prompt
This commit is contained in:
parent
6dbae7ee11
commit
ebb2e4ef5e
24
.bash_prompt
24
.bash_prompt
@ -1,5 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# taken from https://github.com/kremalicious/dotfiles/blob/master/bash_prompt
|
||||
#
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# bash_prompt, from @mathiasbynens
|
||||
# slightly modified
|
||||
@ -99,24 +103,20 @@ fi;
|
||||
if [[ "${USER}" == "root" ]]; then
|
||||
userStyle="${red}";
|
||||
else
|
||||
userStyle="${orange}";
|
||||
userStyle="${gray}";
|
||||
fi;
|
||||
|
||||
# Highlight the hostname when connected via SSH.
|
||||
if [[ "${SSH_TTY}" ]]; then
|
||||
hostStyle="${bold}${cyan}";
|
||||
PS1="\[\033]0;\W • \h\007\]"; # Set the terminal title
|
||||
PS1+="\n";
|
||||
PS1+="\[${userStyle}\]\u "; # username
|
||||
PS1+="\[${orange}\]\h \[${reset}\]"; # host
|
||||
else
|
||||
hostStyle="${cyan}";
|
||||
PS1="\[\033]0;\W\007\]"; # Set the terminal title
|
||||
PS1+="\n";
|
||||
fi;
|
||||
|
||||
# Set the terminal title to the current working directory.
|
||||
PS1="\[\033]0;\W • \h\007\]";
|
||||
PS1+="\n";
|
||||
PS1+="\[${userStyle}\]\u"; # username
|
||||
PS1+="\[${dim}\] at ";
|
||||
PS1+="\[${hostStyle}\]\h\[${reset}\]"; # host
|
||||
PS1+="\[${dim}\] in ";
|
||||
PS1+="\[${blue}\]\w"; # working directory full path
|
||||
PS1+="\[${cyan}\]\w"; # working directory full path
|
||||
PS1+="\$(prompt_git \" \[${gray}\]\")"; # Git repository details
|
||||
PS1+="\n";
|
||||
PS1+="\[${white}\]→ \[${reset}\]"; # `→` (and reset color)
|
||||
|
Loading…
Reference in New Issue
Block a user