mirror of https://github.com/nirenjan/dotfiles.git
Fix PS1 in bash
Without \[ \] wrapping, bash was getting confused where the cursor actually was. This fixes that problem.vimbundler
parent
66f3164bda
commit
cf2cd69b13
|
@ -6,13 +6,19 @@ add_to_path() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Define the colors used by the prompt
|
||||||
|
T_B=$(tput setaf 4) # Blue
|
||||||
|
T_G=$(tput setaf 2) # Green
|
||||||
|
T_Y=$(tput setaf 3) # Yellow
|
||||||
|
T_S=$(tput sgr0) # Reset
|
||||||
|
|
||||||
# Import the Git prompt shell functions. These can be found
|
# Import the Git prompt shell functions. These can be found
|
||||||
# @github:git/git/contrib/completion/git_prompt.sh
|
# @github:git/git/contrib/completion/git_prompt.sh
|
||||||
if [ -f $HOME/.git_prompt.sh ]; then
|
if [ -f $HOME/.git_prompt.sh ]; then
|
||||||
source $HOME/.git_prompt.sh
|
source $HOME/.git_prompt.sh
|
||||||
export PS1='\e[34m\u@\h \e[0m[\e[32m$(smartwd)$(__git_ps1 " \e[33m(%s)")\e[0m] '
|
export PS1='\[$T_B\]\u@\h \[$T_S\][\[$T_G\]$(smartwd)$(__git_ps1 " \[$T_Y\](%s)")\[$T_S\]]\$ '
|
||||||
else
|
else
|
||||||
export PS1='\e[34m\u@\h \e[0m[\e[32m$(smartwd)\e[0m] '
|
export PS1='\[$T_B\]\u@\h \[$T_S\][\[$T_G\]$(smartwd)\[$T_S\]]\$ '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add $HOME/bin to PATH
|
# Add $HOME/bin to PATH
|
||||||
|
|
Loading…
Reference in New Issue