我最近在 ssh 进入的机器上安装了 GNU screen。如何让 GNU 屏幕使用 256 色?
到目前为止,我已经尝试将以下内容添加到我的.screenrc:
term screen-256color
Run Code Online (Sandbox Code Playgroud)
和
attrcolor b ".I" # allow bold colors - necessary for some reason
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground
defbce on # use current bg color for erased chars
Run Code Online (Sandbox Code Playgroud)
但都没有奏效。
在登录 shell 中,在启动 screen 之前,当我运行这个打印 256 色的脚本时,我得到了正常的输出。当我使用命令时,tput colors我得到了输出8。
当我启动 screen 并运行脚本时,我得到 16 种颜色映射到 256 种颜色 - 有大块纯色。当我运行时,tput colors我得到 …
gnu-screen ×1