Hi team!

Small and hopefully nonintrusive patch for an added feature I'd like to see
in screen.  I failed to locate a working git repository. Is savannah dead?
Using an old checkout of mine, I created a patch the old fashionned way.
-- see attached.

thanks,
        Jw
-- 
 o \  Juergen Weigert  paint it green!    __/ _=======.=======_
<V> | j...@suse.de       back to ascii!  __/        _---|____________\/
 \  | 0911 74053-508                __/          (____/            /\
(/) | _____________________________/              _/ \_ vim:set sw=2 wm=8
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
When used as a minicom replacement, the hard coded sleep(5)
is really annoying, when trying to find the correct line and parameters.

This patch makes this fatal error message behave more like an ordinary message.
We now honor msgwait variable and honors user input.
2009-05-29, j...@suse.de

--- screen.git.old/src/screen.c.orig	2009-01-16 12:34:30.000000000 +0100
+++ screen.git.old/src/screen.c	2009-05-31 13:38:27.309756000 +0200
@@ -1414,8 +1414,13 @@
       debug("We open one default window, as screenrc did not specify one.\n");
       if (MakeWindow(&nwin) == -1)
 	{
-	  Msg(0, "Sorry, could not find a PTY.");
-	  sleep(5);
+	  fd_set rfd;
+	  struct timeval tv = { MsgWait/1000, 1000*(MsgWait%1000) };
+	  FD_SET(0, &rfd);
+
+	  Msg(0, "Sorry, could not find a PTY or TTY.");
+	  // allow user to exit early by pressing any key.
+	  select(1, &rfd, NULL, NULL, &tv);
 	  Finit(0);
 	  /* NOTREACHED */
 	}

Reply via email to