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, address@hidden --- 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 */ }