Opened 8 years ago

Closed 8 years ago

#3009 closed bug (wontfix)

ghci-6.10.1 has odd buffering behavior

Reported by: judahj Owned by:
Priority: normal Milestone:
Component: GHCi Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

In ghci-6.10.1:

Prelude> :m +System.IO
Prelude System.IO> hGetBuffering stdin
NoBuffering
Prelude System.IO> getChar
asdf
'a'
Prelude System.IO> sdf

<interactive>:1:0: Not in scope: `sdf'
Prelude System.IO> 

That is, even though stdin is supposed to be unbuffered, getChar doesn't return until '\n' is entered.

The above works correctly in ghci-6.8.3.

Also, manually setting the buffering in ghci-6.10.1 works, but only for the duration of one statement:

Prelude System.IO> hSetBuffering stdin NoBuffering >> getChar
a'a'
Prelude System.IO> getChar
asdf
'a'
Prelude System.IO> sdf

<interactive>:1:0: Not in scope: `sdf'
Prelude System.IO> 

Change History (1)

comment:1 Changed 8 years ago by simonmar

Architecture: x86Unknown/Multiple
difficulty: Unknown
Operating System: MacOS XUnknown/Multiple
Resolution: wontfix
Status: newclosed

This is another editline thing, I think. Editline is turning on ICANON and IECHO after it has finished reading the input, even if it was turned off before.

I can't see an easy workaround, and we don't want to invest significant effort into fixing editline-related problems since we're moving to haskeline anyway.

Note: See TracTickets for help on using tickets.