aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-02-19 09:35:04 +0000
committerRon Yorston <rmy@pobox.com>2023-02-19 09:35:04 +0000
commit329f907b27405b3044a83b728109ceff0decef61 (patch)
tree700982315f1d8ee929eb2d92c130f75d37637df1
parent6e0a6b7e5d8960c176aa18cb45819f7108df4ae3 (diff)
downloadbusybox-w32-329f907b27405b3044a83b728109ceff0decef61.tar.gz
busybox-w32-329f907b27405b3044a83b728109ceff0decef61.tar.bz2
busybox-w32-329f907b27405b3044a83b728109ceff0decef61.zip
ash: only reset ANSI emulation in interactive loop
Commit 54d2ea4b4 (ash: reset ANSI emulation at prompt) worked around a problem with MSYS2 applications. This seems to have been fixed in more recent versions of MSYS2 but there's still value in retaining the workaround for other such cases. However, the call to reset ANSI emulation is probably being made more often than necessary. Move it out of setprompt_if() and into the main shell interactive loop.
-rw-r--r--shell/ash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index e185c3b7f..090066765 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3077,9 +3077,6 @@ setprompt_if(smallint do_set, int whichprompt)
3077 default: /* 0 */ 3077 default: /* 0 */
3078 prompt = nullstr; 3078 prompt = nullstr;
3079 } 3079 }
3080#if ENABLE_PLATFORM_MINGW32
3081 skip_ansi_emulation(TRUE);
3082#endif
3083#if ENABLE_ASH_EXPAND_PRMT 3080#if ENABLE_ASH_EXPAND_PRMT
3084 pushstackmark(&smark, stackblocksize()); 3081 pushstackmark(&smark, stackblocksize());
3085 putprompt(expandstr(prompt, PSSYNTAX)); 3082 putprompt(expandstr(prompt, PSSYNTAX));
@@ -14573,6 +14570,9 @@ cmdloop(int top)
14573 inter++; 14570 inter++;
14574 chkmail(); 14571 chkmail();
14575 } 14572 }
14573#if ENABLE_PLATFORM_MINGW32
14574 skip_ansi_emulation(TRUE);
14575#endif
14576 n = parsecmd(inter); 14576 n = parsecmd(inter);
14577#if DEBUG 14577#if DEBUG
14578 if (DEBUG > 2 && debug && (n != NODE_EOF)) 14578 if (DEBUG > 2 && debug && (n != NODE_EOF))