diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index eca90d463..6cad795d8 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -132,7 +132,6 @@ main(int argc, char *argv[]) program_state.early_options = 1; /* handle -dalthackdir, -s , --version, --showpaths */ early_options(&argc, &argv, &dir); - program_state.early_options = 0; #ifdef CHDIR /* * Change directories before we initialize the window system so @@ -146,6 +145,7 @@ main(int argc, char *argv[]) #ifdef __linux__ check_linux_console(); #endif + program_state.early_options = 0; initoptions(); #ifdef PANICTRACE diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index b437ad98e..2ff0258f3 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -219,6 +219,8 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ // windowtype = gc.chosen_windowtype; // windowtype = gc.chosen_windowtype; + program_state.early_options = 1; + #if !defined(MSWIN_GRAPHICS) nethack_enter_consoletty(); consoletty_open(1); @@ -254,12 +256,10 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ * which clears out gp.fqn_prefix[] */ // iflags.windowtype_deferred = TRUE; - program_state.early_options = 1; /* if (GUILaunched || IsDebuggerPresent()) */ early_options(&argc, &argv, &dir); + program_state.early_options = 0; - - initoptions(); #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) chdir(gf.fqn_prefix[HACKPREFIX]); diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f509cbc51..c9bdd4b06 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -766,7 +766,7 @@ getret(void) #if defined(MICRO) || defined(WIN32CON) getreturn("to continue"); #else - if (!isatty(STDIN_FILENO)) + if (!isatty(STDIN_FILENO) || program_state.early_options) return; HUPSKIP(); xputs("\n");