We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87e72c3 commit 8fee3f6Copy full SHA for 8fee3f6
src/libstd/io/stdio.rs
@@ -296,7 +296,13 @@ pub struct StdReader {
296
impl Reader for StdReader {
297
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
298
let ret = match self.inner {
299
- TTY(ref mut tty) => tty.read(buf),
+ TTY(ref mut tty) => {
300
+ // Flush the task-local stdout so that weird issues like a
301
+ // print!'d prompt not being shown until after the user hits
302
+ // enter.
303
+ flush();
304
+ tty.read(buf)
305
+ },
306
File(ref mut file) => file.read(buf).map(|i| i as uint),
307
};
308
match ret {
0 commit comments