I am using:
red=$(tput setaf 1)
green=$(tput setaf 2)
blue=$(tput setaf 4)
reset=$(tput sgr0)
export PS1="\[$red\]\u\[$reset\]@\[$green\]\h\[$reset\]:\[$blue\]\w\[$reset\]\$ "
export EDITOR=nano
This is what shows: []\u[]@[]\h[]:[]\w[]$
How can I fix this? Seems like bash does not interprete the special characters.
echo $TERM
for you?~/.bashrc
and you shouldn't exportPS1
, which is a shell setting and not an environment variable. If the lines aren't in.bashrc
, put them there and read this.