Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zsh 如何在GNU屏幕中显示具有活动的硬状态选项卡?_Zsh_Gnu Screen_Screenrc - Fatal编程技术网

Zsh 如何在GNU屏幕中显示具有活动的硬状态选项卡?

Zsh 如何在GNU屏幕中显示具有活动的硬状态选项卡?,zsh,gnu-screen,screenrc,Zsh,Gnu Screen,Screenrc,每次我有超过4个标签,我真的很想知道哪一个有活动。 到目前为止,我一直受益于rxvt标签系统。它在未显示但具有活动的选项卡旁边显示一个*。例如,当你在IRC频道时,它真的很有用。 我如何使用zsh/screen进行此操作 这是我的.zshrc: function precmd { echo -ne "\033]83;title zsh\007" } function preexec { local foo="$2 " local bar=${${=foo}[1]} echo -

每次我有超过4个标签,我真的很想知道哪一个有活动。 到目前为止,我一直受益于rxvt标签系统。它在未显示但具有活动的选项卡旁边显示一个*。例如,当你在IRC频道时,它真的很有用。 我如何使用zsh/screen进行此操作

这是我的.zshrc:

function precmd {
  echo -ne "\033]83;title zsh\007"
}

function preexec {
  local foo="$2 "
  local bar=${${=foo}[1]}
  echo -ne "\033]83;title $bar\007"
}
还有我的屏幕

hardstatus off
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'

[...]
shell "/usr/bin/zsh"

aclchg :window: -rwx #?
aclchg :window: +x title

手册中记录了这一点:

  monitor [on|off]

   Toggles  activity  monitoring  of  windows.   When  monitoring is
   turned on and an affected window is switched into the background,
   you  will receive the activity notification message in the status
   line at the first sign of output and  the  window  will  also  be
   marked  with  an `@' in the window-status display.  Monitoring is
   initially off for all windows.
您可以通过
C-a M
手动切换当前窗口的监视,或者如果您希望默认情况下打开所有窗口的监视,请将
defmonitor on
添加到
screenrc
中。启用后,硬状态行中当前窗口左侧或右侧的任何窗口(在
硬状态字符串中分别扩展为
%-Lw
%+Lw
)将在窗口编号后面的连字符后显示
@
符号。您还将收到一条警报消息,可通过
activity
命令进行配置

在我的系统中,
@
直到窗口中的其他内容发生更改后才会显示。可以通过从配置文件中删除
hardstatus off
来修复此问题

最后,我强烈建议你试试。GNU屏幕上的开发大多陷于停顿,而
tmux
是一个积极维护和开发的替代品,具有相当大的灵活性