根据终端在.screenrc中的支持,无法设置颜色(Unable set colors according to Terminal's support in .screenrc)

编程入门 行业动态 更新时间:2024-10-26 15:17:59
根据终端在.screenrc中的支持,无法设置颜色(Unable set colors according to Terminal's support in .screenrc)

我想在.screenrc中有一个if-else循环用于以下代码,以便在我的终端支持256色时运行它。 否则,它不会运行。

attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm" termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"

如何在.screenrc中创建if-else循环?

I would like to have a if-else loop in .screenrc for the following codes such that it is run if my terminal supports 256 colors. Otherwise, it is not run.

attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm" termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"

How can you make the if-else loop in .screenrc?

最满意答案

这应该已经由terminfo数据库文件设置。 在我的情况下,我的默认终端是xterm。 它使用8种颜色,用vi反映在vi中

:设置termcap

命令检查t_Co项目,设置为8.如果我将我的终端更改为另一种终端类型,如gnome-256color使用256种颜色,那么vi将显示t_Co等于256.我不知道为什么你需要尝试和在.vimrc文件中设置它。

This should already be set by the terminfo database file. In my case my default terminal is xterm. It uses 8 colors which is reflected in vi by using the

:set termcap

command an inspecting the t_Co item which is set to 8. If I change my terminal to another terminal type like gnome-256color which uses 256 colors then vi will show t_Co as equal to 256. I'm not sure why you need to try and set this in your .vimrc file.

更多推荐

本文发布于:2023-07-26 03:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1270740.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:终端   颜色   screenrc   Unable   support

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!