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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -