GNU Screen 在窗口标题前添加美元符号

GNU Screen 在窗口标题前添加美元符号

我最近将我的.screenrc从一台计算机(Mac OSX 10.4)复制到另一台计算机(Fedora 16)

现在,在 Fedora 计算机上,$所有窗口标题前面都有一个。

这是我的硬状态行:

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

我设置了一些屏幕以自动启动。

#Default Screens
screen -t foo 0
screen -t bar 1
screen -t fizz 2
screen -t buzz 3
screen -t bag-and-tag 4
screen -t deployment-zone 5

但是当我启动时显示的窗口标题screen前面有一个美元符号:

 (0*$foo)  1$ bar  2$ fizz  3$ buzz  4$ bag-and-tag  5-$ deployment-zone

我认为这与 shell 环境的差异有关(Mac OSX Darwin 与完整 Linux),

答案1

查看windows文档中的命令,你会看到:

 The current window is marked with a `*'; the previous window is
 marked with a `-'; all the windows that are logged in are marked
 with a `$' (*note Login::); a background window that has received
 a bell is marked with a `!'; a background window that is being
 monitored and has had activity occur is marked with an `@' (*note
 Monitor::); a window which has output logging turned on is marked
 with `(L)'; windows occupied by other users are marked with `&' or
 `&&' if the window is shared by other users; windows in the zombie
 state are marked with `Z'.

表示$已启动登录 shell。终端会话已注册到 和whow并且~/.bash_profile将在 shell 启动时运行。

答案2

我已经获取了您的硬状态字符串并对其进行了修改,以仅取出$字符:

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

基本上,$角色的添加是因为window flags我们正在进行。以下是上述更改的摘录:

  • %-Lw%%-w%-L在这里删除window flags所有窗口的字符当前选定的窗口(带有 * 标记的窗口)。
  • %+Lw%%-w%- 与上述适用于 Windows 的情况相同当前选定的窗口。
  • %n*%f%t%n*%t- 选择当前选定的窗口(注意*

以下是参考关于 GNU Screen 字符串转义的链接它包含有关上述字符串中每个字符的更多信息和解释。

相关内容