diff options
Diffstat (limited to 'src/sys/con_tty.c')
| -rw-r--r-- | src/sys/con_tty.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sys/con_tty.c b/src/sys/con_tty.c index 547521c7..e4b2ad5c 100644 --- a/src/sys/con_tty.c +++ b/src/sys/con_tty.c @@ -42,6 +42,7 @@ called before and after a stdout or stderr output ============================================================= */ +extern qboolean stdinIsATTY; static qboolean stdin_active; // general flag to tell about tty console mode static qboolean ttycon_on = qfalse; @@ -270,21 +271,19 @@ Initialize the console input (tty mode if possible) void CON_Init( void ) { struct termios tc; - const char* term = getenv("TERM"); // If the process is backgrounded (running non interactively) // then SIGTTIN or SIGTOU is emitted, if not caught, turns into a SIGSTP signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); - + // If SIGCONT is received, reinitialize console signal(SIGCONT, CON_SigCont); // Make stdin reads non-blocking fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) | O_NONBLOCK ); - if (isatty(STDIN_FILENO) != 1 - || (term && (!strcmp(term, "raw") || !strcmp(term, "dumb")))) + if (!stdinIsATTY) { Com_Printf("tty console mode disabled\n"); ttycon_on = qfalse; |
