diff options
author | Ron Yorston <rmy@pobox.com> | 2024-04-29 10:37:59 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-04-29 10:37:59 +0100 |
commit | af195b0c979c53739d0ba7e054667b3c548feaa9 (patch) | |
tree | 8aa9617027a39b94abb943864a3105a00e38aa64 | |
parent | e21f531c297d1567720c8b0f1c9bab7daf0cfdad (diff) | |
download | busybox-w32-af195b0c979c53739d0ba7e054667b3c548feaa9.tar.gz busybox-w32-af195b0c979c53739d0ba7e054667b3c548feaa9.tar.bz2 busybox-w32-af195b0c979c53739d0ba7e054667b3c548feaa9.zip |
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)
-rw-r--r-- | shell/ash.c | 6 |
1 files 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) | |||
12656 | int val; | 12656 | int val; |
12657 | int c; | 12657 | int c; |
12658 | 12658 | ||
12659 | #if ENABLE_ASH_NOCONSOLE | ||
12660 | noconsole = console_state(); | ||
12661 | #endif | ||
12659 | if (login_sh != NULL) { /* if we came from startup code */ | 12662 | if (login_sh != NULL) { /* if we came from startup code */ |
12660 | minusc = NULL; | 12663 | minusc = NULL; |
12661 | #if ENABLE_PLATFORM_MINGW32 | 12664 | #if ENABLE_PLATFORM_MINGW32 |
12662 | dirarg = NULL; | 12665 | dirarg = NULL; |
12663 | title = NULL; | 12666 | title = NULL; |
12664 | # if ENABLE_ASH_NOCONSOLE | ||
12665 | noconsole = console_state(); | ||
12666 | # endif | ||
12667 | # if ENABLE_SUW32 | 12667 | # if ENABLE_SUW32 |
12668 | delayexit = 0; | 12668 | delayexit = 0; |
12669 | # endif | 12669 | # endif |