Issue 13778 - Flush stream when std.stdio.writeln() is called
Summary: Flush stream when std.stdio.writeln() is called
Status: RESOLVED DUPLICATE of issue 15786
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-26 12:30 UTC by Bruno Medeiros
Modified: 2016-03-11 12:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bruno Medeiros 2014-11-26 12:30:15 UTC
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 Bruno Medeiros 2016-03-11 12:33:19 UTC

*** This issue has been marked as a duplicate of issue 15786 ***