问题
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