When I set PS1
variable in ~/.bash_profile
, it worked as configured. However, the history is somehow messed up.
When I press Arrow Up
or Ctrl+P
to view commands I typed, it starts to duplicate partially at some points. The scenario is displayed below(pay attention to cd /Co
which is the duplicated part):
Although visually duplicated, when press enter I still get the correct result in history commands.
Here's my system information:
- OS: Mac OS X 10.9.4
- Terminal: system default terminal, iTerm 2
I set PS1
in my .bash_profile
like this:
PS1='${YELLOW}\u${WHITE} in ${GREEN}\w${WHITE}${YELLOW}`__git_ps1 " on
%s"`${WHITE}\r\n${NORMAL}$ '
PS1='${YELLOW}\[\u\]${WHITE} in ${GREEN}\[\w\]${WHITE}${YELLOW}
__git_ps1 " on %s"${WHITE}\[\r\]\[\n\]${NORMAL}$ '
but it seems not wokring – jasonslyvia Oct 13 '14 at 07:05PS1='\[${YELLOW}\]\u\[${WHITE}\] in \[${GREEN}\]\w\[${WHITE}\]\[${YELLOW}\]
__git_ps1 " on %s"\[${WHITE}\]\r\n\[${NORMAL}$\] '
– jasonslyvia Oct 14 '14 at 05:52