bash - Adding colour to prompt stops updating current directory -
my former prompt this:
ps1='[\u@\h $(x=${pwd%/*}; echo ${x##*/}/${pwd##*/})] \! $ '
that monochrome prompt dynamically display last 2 directories in current working directory. changed add colour:
ps1="\[\033[01;32m\]\u@\h\[\033[01;35m\] $(x=${pwd%/*}; echo ${x##*/}/${pwd##*/})\[\033[00m\] \! $ "
the colour works directory doesn't change cd
around system. why not?
this 1 single quote works fine :
ps1='\[\033[01;32m\]\u@\h\[\033[01;35m\] $(x=${pwd%/*}; echo ${x##*/}/${pwd##*/})\[\033[00m\] \! $'
Comments
Post a Comment