Bug 13778 – Flush stream when std.stdio.writeln() is called
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-11-26T12:30:00Z
Last change time
2016-03-11T12:33:19Z
Assigned to
nobody
Creator
bruno.do.medeiros+deebugz
Comments
Comment #0 by bruno.do.medeiros+deebugz — 2014-11-26T12:30:15Z
This is an enhancement request to flush the stdio stream whenever std.stdio.writeln is called (but not for std.stdio.write).
The problem this is causing, is for example that when running D programs under Eclipse (which creates its own console), no flushing is done when a newline is received. According to this SO question:
http://stackoverflow.com/questions/19498040/eclipse-console-writes-output-only-after-the-program-has-finished , Adam D Ruppe has commented the following:
"I'm not entirely sure what's going on here, but I think the line buffering only happens if the receiving end is a regular terminal. Otherwise, it gets the same buffering as any other file (because it likely is any other file). With Eclipse, again I'm guessing, it is probably talking to the eclipse process through a pipe, and that isn't registering as an interactive terminal so it goes back to full buffering."
As a note of interest, Java's `System.out.println()` has the behavior requested here, it does flushing automatically at the end of the call.
Comment #1 by bruno.do.medeiros+deebugz — 2016-03-11T12:33:19Z
*** This issue has been marked as a duplicate of issue 15786 ***