带有 tcsh 的彩色手册页?
实现的彩色联机帮助页
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
我真的很喜欢可以在 .bashrc 或 .zshrc 中 。 我的问题是:如何在 tcsh 中导出这些变量?我必须在工作中使用 tcsh,但无法使其工作。我尝试了很多变体,但没有任何效果。简单地用 setenv 替换导出并用“”替换 = 并不能解决问题。 但它应该以某种方式起作用。如果我使用此导出集从我的 zsh 中启动 tcsh,我也可以在 tcsh 中享受彩色手册页。但这是一个丑陋的解决方法。
I really like the colored manpages which can are achieved by
export LESS_TERMCAP_mb=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[01;31m'
export LESS_TERMCAP_md=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[01;31m'
export LESS_TERMCAP_me=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[0m'
export LESS_TERMCAP_se=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[0m'
export LESS_TERMCAP_so=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[01;44;33m'
export LESS_TERMCAP_ue=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[0m'
export LESS_TERMCAP_us=
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
\E[01;32m'
in your .bashrc or .zshrc.
My question is: How do I export these variables in tcsh? I have to use tcsh at work and cannot get it working. I tried plenty of variations, but nothing worked. Simply replacing export with setenv and = with " " doesn't do the trick.
But it should work somehow. If i start a tcsh out of my zsh with this exports set I can enjoy colored manpages in tcsh, also. But that's an ugly workaround.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
执行此操作的方法是
tcsh
原生的,并且可移植到不同的终端类型,方法是使用echotc
内置命令:请参阅
man 5 terminfo
用于termcap
代码和颜色代码。md
是enter_bold_mode
我
是exit_attribute_mode
AF
是set_a_foreground
AB
是set_a_background
顺便说一下,要在 Bash 中执行此操作,请使用外部实用程序
tput
和 terminfo 功能名称:The way to do this which is native to
tcsh
and is portable to different terminal types is to use theechotc
builtin command:See
man 5 terminfo
for thetermcap
codes and color codes.md
isenter_bold_mode
me
isexit_attribute_mode
AF
isset_a_foreground
AB
isset_a_background
By the way, to do this in Bash, use the external utility
tput
and the terminfo capability names:问题是 tcsh 不会解释变量名称中的转义序列,因此当您尝试使用 tcsh 设置环境变量时,环境变量最终会以文字
\E
结尾。这是解决这个问题的一种方法,使用 Bash 来解释转义序列,尽管它有点难看:The problem is that tcsh isn't interpreting the escape sequence in your variable name, so the environment variable ends up with a literal
\E
in it when you try to set it with tcsh. Here's one way you can get around that, using Bash to interpret the escape sequences, although it's a little ugly: