Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#824 msys-1.0.10 stdin/stdout IO delay

MSYS
closed
Earnie Boyd
pty (4)
duplicate
Duplicate
2013-01-31
2005-08-17
Douglas Moyes
No

MSYS will not flush the stdout buffer to the terminal
when a MinGW C program is waiting for input. The
output buffer will only flush after the program
terminates. Here is a code example I used in my online
C crash course that showed this problem:

#include <stdio.h>

int main(){
int age;
char name[40];

printf\("What is your name?"\);
scanf\("%s",name\);
printf\("What is your age?"\);
scanf\("%d",&age\); /\*We must pass a reference to scanf
            for non-pointers\*/
printf\("\nHello %s\!",name\);
if \(age&gt;=50\)
    printf\("Wow, you're an antique\!"\);
else if \(age&lt;=16\)
    printf\("Hey there genius\!"\);
printf\(" See ya\!\n"\);
printf\("\n\nRead age as:%d read name

as:\"%s\"\n",age,name);
}

Discussion

  • Earnie Boyd
    Earnie Boyd
    2005-08-18

    Logged In: YES
    user_id=15438

    This issue is known and a solution has yet to be found. The
    issue is with PTY emulation used by RXVT. If you ``start
    /msys --norxvt'' it will use sh and TTY emulation and you
    test will work fine. The work around to the issue is to use
    flushall.

     
  • Earnie Boyd
    Earnie Boyd
    2005-08-18

    • milestone: --> Known_bugs
    • status: open --> closed-duplicate
     
  • Douglas Moyes
    Douglas Moyes
    2005-08-29

    Logged In: YES
    user_id=1099656

    MSYS works fine without rxvt, why not remove it from the
    package completely until it works correctly? This would
    avoid having to modify existing code and prevent others who
    use MSYS from getting confused.

     
  • Douglas Moyes
    Douglas Moyes
    2005-08-29

    • status: closed-duplicate --> open-duplicate
     
  • Earnie Boyd
    Earnie Boyd
    2005-08-29

    Logged In: YES
    user_id=15438

    There are features that RXVT provides that the windows
    console terminal doesn't. Therefore RXVT will remain but
    you can easily modify the short cut to start without RXVT if
    you wish.

    Earnie

     
  • Earnie Boyd
    Earnie Boyd
    2005-08-29

    • status: open-duplicate --> closed-duplicate
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-31

    • labels: MSYS --> pty
    • status: closed-duplicate --> closed
    • resolution: --> duplicate
    • category: --> Duplicate
    • milestone: Known_bugs --> MSYS