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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -