From f9704ce36e2396001b34d86a01b75af607901f94 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 13 Feb 2024 18:46:17 +0900 Subject: [PATCH] unix/input: Flush the prompt after writing it to stdout. Depending on your setup, stdout might be buffered/line-buffered. Signed-off-by: YAMAMOTO Takashi --- ports/unix/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/unix/input.c b/ports/unix/input.c index c5bf719738..31926a5a8e 100644 --- a/ports/unix/input.c +++ b/ports/unix/input.c @@ -43,6 +43,7 @@ char *prompt(char *p) { // simple read string static char buf[256]; fputs(p, stdout); + fflush(stdout); char *s = fgets(buf, sizeof(buf), stdin); if (!s) { return NULL;