Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

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 (2)

comment:1 Changed 9 years ago by simonmar

Resolution: duplicate
Status: newclosed

We already have a ticket for this: #2189

comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.