repl: make sure the prompt is output before user input (on windows) (#20035)

This commit is contained in:
gym603 2023-11-30 00:12:21 +08:00 committed by GitHub
parent 0b2feefd87
commit f4937aef9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ![]rune {
r.previous_lines[0] = []rune{} r.previous_lines[0] = []rune{}
} }
print(r.prompt) print(r.prompt)
unsafe { C.fflush(C.stdout) }
r.current = os.get_raw_line().runes() r.current = os.get_raw_line().runes()
r.previous_lines[0] = []rune{} r.previous_lines[0] = []rune{}
r.search_index = 0 r.search_index = 0