Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running screen -D -R (with optionally using -S name), and it works great, but has one problem - when given screen doesn't exist earlier, i get notification "New screen...", and irritating wait.

How can I disable this particular notification?

share|improve this question
It's just a notification. It's not hanging, you can start typing, the notification will disappear and everything starts working. – Lekensteyn Aug 30 '10 at 11:03
I know, but it's annoying. And was hoping that there is a way to remove it. Besides - it actually stops shell from running - i.e. shell prompt shows only after notification is gone (whether it's timeout, or me pressing some key) – user7385 Aug 30 '10 at 11:07
up vote 1 down vote accepted

Unfortunately, this behavior is hard-coded in the source: the same test is used to determine whether to emit the “New screen...” notification and to determine whether to attach to a running session. (In the screen 4.0.3 source, (rflag && (rflag & 1) == 0) in attacher.c and screen.crflag is 1 for -r plus 2 for each -R.)

If you're willing to recompile, the patch is trivial: remove the line that displays the message from screen.c.

You can make the message go away by typing something. If you don't want to type a key that will reach the application inside the screen window, you can type C-a ` or some other unbound key.

A simple workaround of sorts is to immediately detach the screen session (either with C-a d or with the detach command in the screenrc file; -m on the command line doesn't work for this when -R is also specified), then attach to it again (e.g. by running the same command again).

A really kludgy but fully automated workaround is to include the following lines in the screenrc file to skip messages initially and reenable them one second later:

msgwait 0
screen -t post_initialization 39 sh -c 'sleep 1; screen -X msgwait 5'

(39 is the highest possible window number, it's a compile-time option (MAXWIN).)

Note that both workarounds will hide any message screen chooses to display when it starts, not just the useless “New screen...” one.

share|improve this answer
Finally solved it this way:… but your answer is the most informative. – user7385 Sep 1 '10 at 10:08
the post_initialization method did not work for me. I have gnome terminal running screen -R as its startup command, and it just starts and immediately exits. – Christian Oudard Sep 16 '12 at 21:44

I just had the same problem. In the latest version of screen, you can specify the -q flag to quiet screen, and keep it from showing.

The source shows

if (rflag && (rflag & 1) == 0 && !quietflag)

so I don't know where Gilles found that, or when it was changed.

share|improve this answer

Try adding these to your .screenrc file:

startup_message off
msgwait 1

The latter will cause all the screen messages being visible only for 1 second - that maybe annoyingly short other times, though.

share|improve this answer
I already have startup_message off, and msgwait - well, it's shorter, but it's still there. I could set it to 0, but then it would influence all other notifications as well :( – user7385 Aug 30 '10 at 11:17

Well, I am quite late on the scene, but I just had the same problem. I resolved it by not using -D -R, but just -S. So $ screen -S myScreenName. This starts the screen right away...

share|improve this answer

You must log in to answer this question.