[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash prompt \W (working dir) garbled



Jochen Schulz wrote:
Jimmy Wu:
$ PS1='\W '
~ cd /home
hmee cd /media
meiia cd /boot


Mine doesn't use \W but it works well for me.

I don't have the problem with this testing:

#  export PS1='\W '
~ cd /proc
proc cd /etc
etc cd
~ cd /home
home cd /var
var cd /media
media




I like having a wide, informative and colorful prompt string, with a new line to start typing in .... ;-)


#  echo $PS1
\[\033[1;37m\][ Affinity -- \[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w\[\033[1;36m\]\[\033[1;37m\] ]\n\$ \[\033[0m\] \[\033];$1\u@\h:\w\007\]
[ Affinity -- root@hp-dl380g4-a:/etc ]
#  cat /etc/debian_version
6.0.1


Here's my setup code in my .bashrc file:

if [ $TERM = 'xterm' -o $TERM = 'screen' ]
then
export PS1='\[\033[1;37m\][ Affinity -- \[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w\[\033[1;36m\]\[\033[1;37m\] ]\n\$ \[\033[0m\] \[\033];$1\u@\h:\w\007\]'
else
        export PS1='\h:\w\$ '
fi



--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


Reply to: