Opened 6 years ago

Closed 6 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: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

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 6 years ago by simonmar

  • Architecture changed from x86 to Unknown/Multiple
  • difficulty set to Unknown
  • Operating System changed from MacOS X to Unknown/Multiple
  • Resolution set to wontfix
  • Status changed from new to closed

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.