mirror of
https://github.com/kremalicious/dotfiles.git
synced 2024-11-22 09:47:21 +01:00
tweak bash_prompt
This commit is contained in:
parent
0e3024e858
commit
31dc084f0e
20
bash_prompt
20
bash_prompt
@ -65,7 +65,7 @@ prompt_git() {
|
||||
if tput setaf 1 &> /dev/null; then
|
||||
tput sgr0; # reset colors
|
||||
bold=$(tput bold);
|
||||
dim=$(tput setaf 7);
|
||||
dim=$(tput setaf 8);
|
||||
reset=$(tput sgr0);
|
||||
# Tomorrow colors, taken from https://github.com/Slava/vim-colors-tomorrow/blob/master/colors/tomorrow.vim
|
||||
black=$(tput setaf 236);
|
||||
@ -99,24 +99,24 @@ 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}${red}";
|
||||
PS1="\[\033]0;\W • \h\007\]"; # Set the terminal title
|
||||
PS1+="\n";
|
||||
PS1+="\[${userStyle}\]\u "; # username
|
||||
PS1+="\[${orange}\]\h \[${reset}\]"; # host
|
||||
else
|
||||
hostStyle="${yellow}";
|
||||
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\007\]"; # working directory base name
|
||||
PS1+="\n";
|
||||
PS1+="\[${cyan}\]\w"; # working directory full path
|
||||
PS1+="\$(prompt_git \" \[${gray}\]\")"; # Git repository details
|
||||
PS1+="\n";
|
||||
PS1+="\[${dim}\]→ \[${reset}\]"; # `→` (and reset color)
|
||||
PS1+="\[${white}\]→ \[${reset}\]"; # `→` (and reset color)
|
||||
export PS1;
|
||||
|
||||
PS2="\[${dim}\]→ \[${reset}\]";
|
||||
PS2="\[${white}\]→ \[${reset}\]";
|
||||
export PS2;
|
||||
|
Loading…
Reference in New Issue
Block a user