From bbac687ce0cef3dbceda4f4be4a9c63cb779cffe Mon Sep 17 00:00:00 2001 From: coffee Date: Fri, 6 Jun 2025 10:06:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=A2=9E=E5=8A=A0HShell=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=AE=80=E6=98=93=E6=A0=87=E5=87=86=E5=BA=93=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81stdout=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HShellLex.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/HShellLex.c b/src/HShellLex.c index a961c22..be1391a 100644 --- a/src/HShellLex.c +++ b/src/HShellLex.c @@ -17,6 +17,9 @@ #endif #endif +#ifndef stdout +#define NOT_SUPPORT_STDOUT +#endif #define CTRL_KEY(k) ((k) & 0x1f) @@ -154,7 +157,9 @@ static void PrintCmdLine() { // 用户已经输入 if (shellInfo_.password == 1 && shellInfo_.userName == 0) { HSHELL_PRINTF("password: \033[0m"); +#ifndef NOT_SUPPORT_STDOUT fflush(stdout); +#endif return ; } @@ -168,7 +173,9 @@ static void PrintCmdLine() { HSHELL_PRINTF("password: \033[0m"); } +#ifndef NOT_SUPPORT_STDOUT fflush(stdout); +#endif return ; } #endif @@ -178,7 +185,9 @@ static void PrintCmdLine() { HSHELL_PRINTF("\033[%dD", len - shellInfo_.cursorPos); } +#ifndef NOT_SUPPORT_STDOUT fflush(stdout); +#endif } static void DeleteBeginByte() {