Ticket #1268 (closed bug: invalid)
GHCi reads from stdin do not handle ^D
| Reported by: | Stefan O'Rear <stefanor@…> | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.1 |
| Component: | GHCi | Version: | 6.7 |
| Keywords: | Cc: | greenrd@… | |
| Operating System: | Linux | Architecture: | x86 |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
stefan@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@stefans:/tmp$ ghc -e 'getChar' -v0 *** Exception: <stdin>: hGetChar: end of file stefan@stefans:/tmp$ ghc -e 'getLine' -v0 foobar "foobar" stefan@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.
Change History
Note: See
TracTickets for help on using
tickets.
