aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-08-01 14:42:02 +0100
committerRon Yorston <rmy@pobox.com>2021-08-01 14:42:02 +0100
commit54d2ea4b479acb19580f90d70fb94e3329ac5d24 (patch)
treef20292d4a13a1c374af2350ceaaba8c677386760
parent83b78af8033e10e959e7b56c74b1c3c5ee2f8fc5 (diff)
downloadbusybox-w32-54d2ea4b479acb19580f90d70fb94e3329ac5d24.tar.gz
busybox-w32-54d2ea4b479acb19580f90d70fb94e3329ac5d24.tar.bz2
busybox-w32-54d2ea4b479acb19580f90d70fb94e3329ac5d24.zip
ash: reset ANSI emulation at prompt
It appears that MSYS2/Cygwin applications turn off virtual terminal processing. This caused literal ANSI escape sequences to be echoed in the shell, which assumed the console state it had applied would remain unchanged. Add a call to skip_ansi_emulation(TRUE) before issuing a shell prompt to ensure that the state is correct. GitHub issue #223.
-rw-r--r--shell/ash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 08e34d6e7..28f74e8a8 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3005,6 +3005,9 @@ setprompt_if(smallint do_set, int whichprompt)
3005 default: /* 0 */ 3005 default: /* 0 */
3006 prompt = nullstr; 3006 prompt = nullstr;
3007 } 3007 }
3008#if ENABLE_PLATFORM_MINGW32
3009 skip_ansi_emulation(TRUE);
3010#endif
3008#if ENABLE_ASH_EXPAND_PRMT 3011#if ENABLE_ASH_EXPAND_PRMT
3009 pushstackmark(&smark, stackblocksize()); 3012 pushstackmark(&smark, stackblocksize());
3010 putprompt(expandstr(prompt, PSSYNTAX)); 3013 putprompt(expandstr(prompt, PSSYNTAX));