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

これはシェル環境の違い(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'.

$、ログイン シェルが開始されたことを示します。ターミナル セッションは および に登録されwhow~/.bash_profileシェルの起動時に実行されます。

答え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%to %-w%- Windowsの場合と同じ現在選択されているウィンドウ。
  • %n*%f%tto %n*%t- 現在選択されているウィンドウの選択範囲( に注意してください*

参考資料はこちらGNU Screen 文字列エスケープに関するリンク上記の文字列の各文字についての詳細情報と説明が記載されています。

関連情報