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.
This commit is contained in:
Daniel Gibson 2015-09-27 18:07:33 +02:00
parent da63c4f41c
commit 5c99ff4657

View file

@ -363,6 +363,8 @@ Posix_InitConsoleInput
void Posix_InitConsoleInput( void ) { void Posix_InitConsoleInput( void ) {
struct termios tc; struct termios tc;
common->StartupVariable( "in_tty", false );
if ( in_tty.GetBool() ) { if ( in_tty.GetBool() ) {
if ( isatty( STDIN_FILENO ) != 1 ) { if ( isatty( STDIN_FILENO ) != 1 ) {
Sys_Printf( "terminal support disabled: stdin is not a tty\n" ); 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( "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 { } else {
Sys_Printf( "terminal support disabled\n" ); Sys_Printf( "terminal support disabled\n" );
} }