On 13. 1. 2016 12:47, Andrew Lowe wrote:
> On 13/01/2016 7:08 PM, Paul Moore wrote:
>> On 13 January 2016 at 10:57, Andrew Lowe <[email protected]> wrote:
>>> /* * Activity Name:
> [snip]
> 
>>> -----------------------------
>>>
>>> I've compiled this using the latest, as of a week ago, versions of
>>> both clang and gcc and the behaviour is the same.
>>
>> This appears to be a buffering issue. When you write to stdout, the
>> data is buffered. You could try adding a fflush(stdout) just before
>> your scanf call. See
>> http://stackoverflow.com/questions/3723795/is-stdout-line-buffered-unbuffered-or-indeterminate-by-default
>>
>>
> for a discussion.
>>
>> Paul
>>
>       Thanks for the thought but that's not going to work. I can't go placing 
> more road blocks in front of the students. It's hard enough as it is to 
> get them to do/understand what's going on without adding fflush() to the 
> mix.
> 
>       I just need the same behaviour as cmd.exe and bash under Linux. Is 
> there something in Mintty/bash that I can "turn on/off"?

See either <https://code.google.com/p/mintty/issues/detail?id=218> or 
<https://github.com/mintty/mintty/issues/218>.

The proposed `winpty ./a.exe` works.

I googled for a way to disable output buffering without changing the program 
code and only idea that showed some promise was a DLL injector that would 
automatically hook all child processes of mintty and call `fflush` 
(periodically) or `setvbuf` (at the right moment after stream set-up) on their 
behalf.

-- 
David Macek

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to