#1268: GHCi reads from stdin do not handle ^D
-------------------------------------------------+--------------------------
    Reporter:  Stefan O'Rear <[EMAIL PROTECTED]>  |        Owner:            
        Type:  bug                               |       Status:  closed    
    Priority:  normal                            |    Milestone:  6.8 branch
   Component:  GHCi                              |      Version:  6.7       
    Severity:  normal                            |   Resolution:  invalid   
    Keywords:                                    |   Difficulty:  Unknown   
          Os:  Linux                             |     Testcase:            
Architecture:  x86                               |  
-------------------------------------------------+--------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 I claim this is not a bug.  GHCi defaults to no buffering on `stdin`,
 whereas when running from the command line you get either line-buffering
 or block-buffering depending on what `stdin` is attached to.  If you want
 line-buffering in GHCi, you can ask for it:

 {{{
 Prelude> :m + System.IO
 Prelude System.IO> hSetBuffering stdin LineBuffering
 Prelude System.IO> getChar
 *** Exception: <stdin>: hGetChar: end of file
 Prelude System.IO> Leaving GHCi.
 }}}

 Perhaps you're complaining about the fact that `NoBuffering` implies
 ICANON on Unix ttys, and hence disables the `^D` processing.  GHC has
 always had this behaviour, as far as I recall.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1268#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to