GNU screen command not showing status bar

蹲街弑〆低调 提交于 2019-12-10 11:24:17

问题


I am new to GNU screen command. I created .screenrc file in my home directory and added below two lines(source) to display the status bar.

caption always
caption string "%{= bW}%3n %{y}%t %{-}%= %{m}%H%?%{-} -- %{c}%l%?%{-} -- %D %M %d %{y}%c"

but I am not seeing the status bar(after entering into screen mode).

When I run source .screenrc, I am getting error "-bash: caption: command not found".

What am I missing here?


回答1:


Problem was that, I already started screen and then added the file .screenrc in my home directory, but active screens are not recognizing the .screenrc file.

so I killed all active screen sessions and then stated new screen session (screen). Now I am able to see the status bar.




回答2:


First, you cannot do soruce .screenrc, since that tries to run the file with bash (or whatever is in the first line if you have #!/some/shellorprogram).

I'm not sure why you are not seeing the status bar, but the source command is a red herring.

Can you try something simpler with the caption, and maybe even something static to see if the syntax is right and it's the format string that is breaking?

Something like

caption always caption string "test caption"

On my Ubuntu server the test caption works, so it's probably your format string. Build it piece by piece to find the busted part.

The other one works, too. Where are you putting your screenrc file?

ls -al ~/.screenrc



来源:https://stackoverflow.com/questions/31538367/gnu-screen-command-not-showing-status-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!