Skip to content

Ctr-c doesn't work in ghci-6.8.1, probably related to #1922

In ghci-6.8.1, pressing Ctrl-c once during an evaluation has no influence, pressing it twice during the same evaluation results in

Prelude Data.List> foldl' (+) 0 [1 .. 20000000]
<interactive>: exception :: GhcException

and it only returns to the prompt after a third Ctrl-c

*** Exception: <<loop>>
Prelude Data.List>

However, then no more computations are performed,only ghci commands (:?, :i, :t, :q) are then processed. A complete sample session, Ctrl-c was pressed once in each of the first two evaluations, twice in the third, then once more to produce *** Exception: <<loop>> and return to the prompt. From then onwards, any expression typed at the prompt results in no activity until a further Ctrl-c is pressed.

dafis@linux:~> ghci
GHCi, version 6.8.1: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> :set +s
Prelude> :m +Data.List
Prelude Data.List> foldl' (+) 0 [1 .. 10000000]
50000005000000
(4.47 secs, 1041858060 bytes)
Prelude Data.List> foldl' (+) 0 [1 .. 20000000]
200000010000000
(8.68 secs, 2081067868 bytes)
Prelude Data.List> foldl' (+) 0 [1 .. 20000000]
<interactive>: exception :: GhcException


*** Exception: <<loop>>
Prelude Data.List> foldl' (+) 0 [1 .. 20000000]

*** Exception: <<loop>>
Prelude Data.List> foldl' (+) 0 [1 .. 20]
*** Exception: <<loop>>
Prelude Data.List> :?
 Commands available from the prompt:

   <statement>                 evaluate/run <statement>
   :add <filename> ...         add module(s) to the current target set
   :browse [[*]<module>]       display the names defined by <module>
   :cd <dir>     Interrupted.
Prelude Data.List> :i foldl
foldl :: (a -> b -> a) -> a -> [b] -> a         -- Defined in GHC.List
Prelude Data.List> :t (+) . (^)
(+) . (^) :: (Integral b, Num a, Num (b -> a)) => a -> (b -> a) -> b -> a
Prelude Data.List> :q
Leaving GHCi.
dafis@linux:~>
Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information