#1268: GHCi reads from stdin do not handle ^D
-------------------------------------------------+--------------------------
    Reporter:  Stefan O'Rear <[EMAIL PROTECTED]>  |       Owner:       
        Type:  bug                               |      Status:  new  
    Priority:  normal                            |   Milestone:       
   Component:  Compiler                          |     Version:  6.7  
    Severity:  normal                            |    Keywords:       
  Difficulty:  Unknown                           |    Testcase:       
Architecture:  x86                               |          Os:  Linux
-------------------------------------------------+--------------------------
{{{
 [EMAIL PROTECTED]:/tmp$ ghc --interactive
    ___         ___ _
   / _ \ /\  /\/ __(_)
  / /_\// /_/ / /  | |      GHC Interactive, version 6.7.20070402, for
 Haskell 98.
 / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
 \____/\/ /_/\____/|_|      Type :? for help.

 Loading package base ... linking ... done.
 Prelude> getChar
 ^D'\EOT'
 Prelude> getLine
 foo^Dbar
 "foo\EOTbar"
 Prelude> Leaving GHCi.
 [EMAIL PROTECTED]:/tmp$ ghc -e 'getChar' -v0
 *** Exception: <stdin>: hGetChar: end of file
 [EMAIL PROTECTED]:/tmp$ ghc -e 'getLine' -v0
 foobar
 "foobar"
 [EMAIL PROTECTED]:/tmp$
 }}}

 In the first case I pressed C-d immediately after getChar began
 waiting, in the second case I pressed it in the middle of the word.
 In both cases the non-interactive output is that which was expected.

 The undesirable GHCi output is confirmed with 6.7.20070402, 6.6, and
 6.4.2.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1268>
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