我最近將我的內容.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 已啟動。終端會話是用 和 註冊的who
,w
並且~/.bash_profile
會在 shell 啟動時運行。
答案2
我已經獲取了 Hardstatus 字串並對其進行了修改以僅取出$
字元:
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%
to%-w%
-L
在這裡獲取字元會刪除window flags
所有窗口前目前選定的視窗(標有 * 的 win)。%+Lw%
to%-w%
- 與上面的 Windows 相同後目前選定的視窗。%n*%f%t
to%n*%t
- 目前選定視窗的選擇(注意*
)
這是參考關於 GNU Screen 字串轉義的鏈接其中包含有關上述字串中每個字元的更多資訊和解釋。