lists.zerezo.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: [Mingw-users] ANSI escape sequences problem



Bengt Werstén wrote:

> I have tried 2 and 3 since I'm limited to the MinGW lib in cygwin. Neither worked and it still buffers and fgetc, fread or read still return when the first enter is pressed. I used setvbuf as
> if (setvbuf(stdin, NULL, _IONBF, 0) == 0)
> {
>         // carry on

Ah.  Right, that's because the pty is in 'cooked' mode by default, and
needs to be changed to 'raw' if you want to process individual
keystrokes.  You can't do this from a MinGW program since it cannot
communicate to the Cygwin pty, but you can do it with 'stty' before
invoking your program, e.g.

$ stty raw -echo; ./yourapp; stty cooked

Brian

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users