[GHC] #1268: GHCi reads from stdin do not handle ^D
GHC
trac at galois.com
Thu Apr 5 19:27:00 EDT 2007
#1268: GHCi reads from stdin do not handle ^D
-------------------------------------------------+--------------------------
Reporter: Stefan O'Rear <stefanor at cox.net> | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.7
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: x86 | Os: Linux
-------------------------------------------------+--------------------------
{{{
stefan at stefans:/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.
stefan at stefans:/tmp$ ghc -e 'getChar' -v0
*** Exception: <stdin>: hGetChar: end of file
stefan at stefans:/tmp$ ghc -e 'getLine' -v0
foobar
"foobar"
stefan at stefans:/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
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list