From af195b0c979c53739d0ba7e054667b3c548feaa9 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 29 Apr 2024 10:37:59 +0100 Subject: ash: detect console state on every call to options() Commit 67ed7484be (ash: detect console state on shell start up) synchronised the noconsole option with the actual state of the window on shell start up. This is insufficient. The user can change the state of the window independently of the noconsole option, leading to confusion and unwanted iconification of the window when unrelated 'set' commands are issued. Detect the current console state on every call to options(). Saves 16-32 bytes. (GitHub issue #325) --- shell/ash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index e32731d41..9ed8506ab 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -12656,14 +12656,14 @@ options(int *login_sh) int val; int c; +#if ENABLE_ASH_NOCONSOLE + noconsole = console_state(); +#endif if (login_sh != NULL) { /* if we came from startup code */ minusc = NULL; #if ENABLE_PLATFORM_MINGW32 dirarg = NULL; title = NULL; -# if ENABLE_ASH_NOCONSOLE - noconsole = console_state(); -# endif # if ENABLE_SUW32 delayexit = 0; # endif -- cgit v1.2.3-55-g6feb