diff --git a/client/src/comms.c b/client/src/comms.c index 209fd47cd..ad82725f3 100644 --- a/client/src/comms.c +++ b/client/src/comms.c @@ -18,6 +18,7 @@ #include "uart/uart.h" #include "ui.h" #include "crc16.h" +#include "util.h" // g_pendingPrompt #include "util_posix.h" // msclock #include "util_darwin.h" // en/dis-ableNapp(); @@ -289,6 +290,10 @@ static void PacketResponseReceived(PacketResponseNG *packet) { } if (flag & FLAG_LOG) { + if (g_pendingPrompt) { + PrintAndLogEx(NORMAL, ""); + g_pendingPrompt = false; + } //PrintAndLogEx(NORMAL, "[" _MAGENTA_("pm3") "] ["_BLUE_("#")"] " "%s", s); PrintAndLogEx(NORMAL, "[" _BLUE_("#") "] %s", s); } else { diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 179b3f343..d04008c03 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -349,6 +349,7 @@ check_script: prompt_compose(prompt, sizeof(prompt), prompt_ctx, prompt_dev); char prompt_filtered[PROXPROMPT_MAX_SIZE] = {0}; memcpy_filter_ansi(prompt_filtered, prompt, sizeof(prompt_filtered), !session.supports_colors); + g_pendingPrompt = true; #ifdef HAVE_READLINE cmd = readline(prompt_filtered); #else @@ -411,6 +412,7 @@ check_script: } #endif // process cmd + g_pendingPrompt = false; int ret = CommandReceived(cmd); // exit or quit if (ret == PM3_EFATAL) diff --git a/client/src/util.c b/client/src/util.c index 808f147f0..e469dc095 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -30,6 +30,8 @@ uint8_t g_debugMode = 0; // global client disable logging variable uint8_t g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG; +// global client tell if a pending prompt is present +bool g_pendingPrompt = false; #ifdef _WIN32 #include diff --git a/client/src/util.h b/client/src/util.h index 156c3a089..663abbc55 100644 --- a/client/src/util.h +++ b/client/src/util.h @@ -23,6 +23,7 @@ extern uint8_t g_debugMode; extern uint8_t g_printAndLog; +extern bool g_pendingPrompt; #define PRINTANDLOG_PRINT 1 #define PRINTANDLOG_LOG 2