3

So as the title suggests my putty stops displaying colors as soon as i enter SU. I dont know if this is how its suppose to work or if there is any work around, already tried googling but only come up with putty color schemes.

heres a print of what i'm talking about

enter image description here

ps: i'm talking about ALL system colors, like the blue colors for folders, green for user, red for tars, not only when i do ls.

1

1 Answer 1

0

had a look here: unix.stackexchange.com/q/256100/130000 and managed to fix it, by adding this to my ~/.bashrc

force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        color_prompt=yes
    else
        color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 fi
 unset color_prompt force_color_prompt


case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .