From 5c99ff46571ca783480e3af556d44bd9dea54d65 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 27 Sep 2015 18:07:33 +0200 Subject: [PATCH] make "./dhewm3 +set in_tty 0" actually work the problem was that the CVar was initialized from the commandline *after* Posix_InitConsoleInput() is called, so it was too late. common->StartupVariable() seems to be the right way to initialize a CVar early. --- neo/sys/posix/posix_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index fb59d053..51538ade 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -363,6 +363,8 @@ Posix_InitConsoleInput void Posix_InitConsoleInput( void ) { struct termios tc; + common->StartupVariable( "in_tty", false ); + if ( in_tty.GetBool() ) { if ( isatty( STDIN_FILENO ) != 1 ) { Sys_Printf( "terminal support disabled: stdin is not a tty\n" ); @@ -415,7 +417,7 @@ void Posix_InitConsoleInput( void ) { Sys_Printf( "WARNING: terminal type '%s' is unknown. terminal support may not work correctly\n", term ); } } - Sys_Printf( "terminal support enabled ( use +set in_tty 0 to disabled )\n" ); + Sys_Printf( "terminal support enabled ( use +set in_tty 0 to disable )\n" ); } else { Sys_Printf( "terminal support disabled\n" ); }