console/linenoise: support buffered stdout
This commit is contained in:
parent
c97a05c0d5
commit
6ce5c7668f
1 changed files with 4 additions and 0 deletions
|
@ -106,6 +106,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -879,6 +880,9 @@ static int linenoiseEdit(char *buf, size_t buflen, const char *prompt)
|
|||
linenoiseEditDeletePrevWord(&l);
|
||||
break;
|
||||
}
|
||||
if (__fbufsize(stdout) > 0) {
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
return l.len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue