如何在 GNU Screen 硬状态中显示先前选择的选项卡?
每次我在控制台中工作时,我都会使用 GNU Screen。我有一个习惯 .screenrc 文件有几个设置。除其他外,我有这样的设置 在底部显示“选项卡”:
hardstatus alwayslastline
hardstatus string "%{= g} %{= w}%-w%{=r}%n %t%{-}%+W"
效果很好,但我想在选项卡中添加一些显示内容的符号 选项卡之前处于活动状态。这怎么能做到呢?
Every time I work in the console I use GNU Screen. I have a custom
.screenrc file with several settings. Among others I have the setting that
shows 'tabs' in the bottom:
hardstatus alwayslastline
hardstatus string "%{= g} %{= w}%-w%{=r}%n %t%{-}%+W"
It works well, but I want to add to the tabs some symbol that shows what
tab was previously active. How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
唉,评论只支持一点格式化功能,所以我创建了一个新答案。
hardstatus 字符串 "%{= g} %{= w}%-Lw%{=r}%n%f* %t% {-}%+LW"
我看不到任何“$”:唉,除了选定的选项卡之外的所有选项卡均未配置 - 仅当在硬状态中使用
%w
(包括当前窗口在内的所有窗口)或%W
(除当前窗口外的所有窗口)时才会显示它们细绳。这些转义符可以在前面加上-
或+
(以显示当前窗口之前或之后的窗口)和L
(以显示窗口的标志)。无法配置行的这些部分的空格、格式或内容 - 它们只有选项卡的编号、标题和带有固定缩进的可选标志。当然,您可以将 Hardstatus 字符串中的
%f
之后的*
替换为空格(对于奇怪的句子感到抱歉,但是 SO 文本引擎奇怪地吃掉了反引号中的空格) - 但没有调整非活动选项卡和非最后选项卡的选项卡编号后的空格,它们将继续“跳转”。Alas, comments support only a bit of formatting abilities, so i created a new answer.
With
hardstatus string "%{= g} %{= w}%-Lw%{=r}%n%f* %t%{-}%+LW"
i can't see any '$':Alas, all tabs besides selected are not configured - they are just shown if
%w
( all windows including current ) or%W
( all windows except current ) are used in hardstatus string. These escapes can be prepended with-
or+
( to show windows before or after current one ) andL
( to show window's flags ). Spaces, or formatting, or content of these parts of line can't be configured - they have only tab's number, title and optionally flags with fixed indents.Sure, you can replace
*
with space after%f
in hardstatus string with two spaces ( sorry for strange sentence, but SO text engine eats spaces in backticks weirdly ) - but without adjusting spaces after tab's number for non-active and non-last tabs they continue "to jump".您可以使用以下字符串:
具有焦点的窗口将标有符号“*”,前一个窗口将标有“-”。
You can use can use following string:
Than window with focus will be marked with symbol '*' and previous one - with '-'.