Putty は SU では色を表示しなくなります

Putty は SU では色を表示しなくなります

タイトルが示すように、SU に入るとすぐに Putty は色の表示を停止します。これが想定された動作方法なのか、回避策があるのか​​はわかりません。すでに Google で検索してみましたが、PuTTY のカラー スキームしか見つかりません。

私が話していることのプリントがこれです

ここに画像の説明を入力してください

追記: ls を実行するときだけでなく、フォルダーの青色、ユーザーの緑色、tar の赤色など、すべてのシステム カラーについて話しているのです。

答え1

ここを見ました: unix.stackexchange.com/q/256100/130000 これを~/.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"
;;
*)
;;

関連情報