1

Is there any way to disable the behavior of gnu-screen, of issuing a clear at startup?

I'm using screen merely as a backstop, so that if disconnected, the session isn't HUP'ed. And I've got my shell (bash) config'd to "exec screen -A" on login, so that I get right into screen automatically.

However, screen immediately issues a clear and then I've got to scroll back up to see whatever login messages there might have been.

Similarly, at exit, I'd like to skip the clear there too, so I can see the results of my .bash_logout.

(If it's any help, my term is usually xterm-color (via Mac OS X's Terminal.app) though I do sometimes come in via ssh from some other node. And I'm generally connecting to an Ubuntu box/instance.)

mvgfr
  • 11

2 Answers2

1

Because screen takes over the entire screen, its not possible to have it leave the terminal buffer unprocessed. If you're interested in the motd specifically, you can always have your .bash_profile call cat /etc/motd, which would give you the same functionality.

Another option is to just call screen manually, which sounds like it might be the behaviour you want anyway--since you're not actively using the screens to do work. This is even further recommended if you're worried about having a compromised account--since the login screen also shows your last login location.

Andrew M.
  • 11,412
1

As mentioned by Redmumba, screen takes over the entire terminal so you can't have it take over the existing buffer and display.

What I have done is changed my .screenrc to display a status bar at the bottom of the terminal window, and trained my fingers to say screen -ADR if I don't see that status bar. That way you have a visual cue that you are in fact running screen, and a reflex that will start it for you before you start to do anything which might not survive accidental disconnecting.

(Also, if you have the current time being displayed in the screen status bar, this acts as a keep-alive signal that can prevent connections from disconnecting due to being idle too long.)