Ticket #2568 (closed bug: duplicate)
hSetBuffering NoBuffering and getChar don't work properly on Windows
| Reported by: | igloo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10 branch |
| Component: | Compiler | Version: | 6.9 |
| Keywords: | Cc: | ||
| Operating System: | Windows | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
With this program:
import System.IO
main = do { hSetBuffering stdin NoBuffering; run }
run = do { getChar; putStrLn "yes"; run }
if I type
abc<enter>def<enter><control-C>
then:
On Linux and OS X I get the desired output:
$ ./q ayes byes cyes yes dyes eyes fyes yes ^Cq: interrupted
In an MSYS window I get:
$ ./q abc def
In a cygwin window or a cmd windows I get:
$ ./q abc yes yes yes yes def yes yes yes yes
and the program doesn't die.
SSHing into cygwin I get:
$ ./q abc def
Change History
Note: See
TracTickets for help on using
tickets.
