From 329f907b27405b3044a83b728109ceff0decef61 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 19 Feb 2023 09:35:04 +0000 Subject: 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. --- shell/ash.c | 6 +++--- 1 file 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) default: /* 0 */ prompt = nullstr; } -#if ENABLE_PLATFORM_MINGW32 - skip_ansi_emulation(TRUE); -#endif #if ENABLE_ASH_EXPAND_PRMT pushstackmark(&smark, stackblocksize()); putprompt(expandstr(prompt, PSSYNTAX)); @@ -14573,6 +14570,9 @@ cmdloop(int top) inter++; chkmail(); } +#if ENABLE_PLATFORM_MINGW32 + skip_ansi_emulation(TRUE); +#endif n = parsecmd(inter); #if DEBUG if (DEBUG > 2 && debug && (n != NODE_EOF)) -- cgit v1.2.3-55-g6feb