[Issue 20215] redirected console app looks hang w/o .flush

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 16 07:58:25 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20215

--- Comment #1 from KnightMare <black80 at bk.ru> ---
UPD

I checked printf/cout behavior:
D/printf: same result - looks freeze
VС++/printf: same result
VC++/cout/cin: flushes

ok. maybe 
readln(...) can be same for repeating C/printf/getchar 
but can be added readlnWithFlush(..)
user will search readXXX, nobody will search flushAndReadXXX
readlnWithFlush will stay near readln then user will think: 
"readlnWithFlush flushes and readln dont flush. ok then.."

u comfort with C/system-style printf/writeln when u remember that need to flush
before input.
me comfort with higher level C#/C++/cout where readln flushes output
automatically and I dont remember that I should flush first.

and I mean not flush every output that expensive, 
I mean "flush output before input when output is not empty or in case u cannot
say that - flush automatically if user ask dont do that"

--


More information about the Digitalmars-d-bugs mailing list