在 SU 中時 Putty 停止顯示顏色

在 SU 中時 Putty 停止顯示顏色

如標題所示,我一進入 SU,我的膩子就停止顯示顏色。我不知道這是否是它應該工作的方式,或者是否有任何解決辦法,已經嘗試過谷歌搜索,但只提出了膩子配色方案。

這是我正在談論的內容的印刷品

在此輸入影像描述

PS:我說的是所有系統顏色,例如資料夾的藍色,使用者的綠色,tars的紅色,而不僅僅是當我執行 ls 時。

答案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"
;;
*)
;;

相關內容