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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -