summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@midokura.com>2024-02-13 18:46:17 +0900
committerDamien George <damien@micropython.org>2024-02-15 16:45:00 +1100
commitf9704ce36e2396001b34d86a01b75af607901f94 (patch)
treee039051e239175f6fe222ed46879888d9e15d7b5
parent06cb6b1e9fe8e4f965f14843be5a4ffe676c7f90 (diff)
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 <yamamoto@midokura.com>
-rw-r--r--ports/unix/input.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/unix/input.c b/ports/unix/input.c
index c5bf71973..31926a5a8 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;