From e121fdb47fb99761bcc5a8b77a0448f8d778ccef Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 3 Mar 2025 15:12:28 +0100 Subject: [PATCH] fix shell standalone --- lib/uuid-console/src/shell.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/uuid-console/src/shell.cpp b/lib/uuid-console/src/shell.cpp index 8005913c1..f5c4a2982 100644 --- a/lib/uuid-console/src/shell.cpp +++ b/lib/uuid-console/src/shell.cpp @@ -113,6 +113,7 @@ void Shell::loop_one() { return; } + switch (mode_) { case Mode::NORMAL: output_logs(); @@ -305,15 +306,15 @@ void Shell::loop_normal() { break; } - // common for all, display the complete line - // added for EMS-ESP +#ifndef EMSESP_STANDALONE + // added for EMS-ESP. Display the complete line erase_current_line(); prompt_displayed_ = false; display_prompt(); - if (cursor_) { printf("\033[%dD", cursor_); } +#endif previous_ = c; @@ -519,7 +520,11 @@ void Shell::maximum_command_line_length(size_t length) { void Shell::process_command() { // added for EMS-ESP if (line_buffer_.empty()) { +#ifndef EMSESP_STANDALONE println(); +#else + display_prompt(); +#endif return; } @@ -544,7 +549,9 @@ void Shell::process_command() { CommandLine command_line{line1}; +#ifndef EMSESP_STANDALONE println(); +#endif prompt_displayed_ = false; if (!command_line->empty()) { @@ -564,8 +571,7 @@ void Shell::process_command() { display_prompt(); } - // don't think we need this for EMS-ESP on ESP32 - // ::yield(); + ::yield(); } void Shell::process_completion() { @@ -581,7 +587,6 @@ void Shell::process_completion() { for (auto & help : completion.help) { std::string help_line = help.to_string(maximum_command_line_length_); - println(help_line); } }