Jules Bean jules at
Tue Oct 14 06:05:19 EDT 2008

Simon Marlow wrote:
> Judah Jacobson wrote:
>> Once small thing I've noticed: UserInterrupt (ctr-c) exceptions are
>> not thrown in ghci, probably because it installs its own signal
>> handlers:
>> Prelude Control.Exception Control.Concurrent> handle (\UserInterrupt
>> -> putStrLn "Caught!") (threadDelay 2000000)
>> ^CInterrupted.
>> For consistency between the compiled and interpreted environments, it
>> would be nice if the above could catch the ctrl-c.  But maybe there's
>> a reason not to do this?  If this change sounds OK, I can take a look
>> at this and try to put together a patch over the weekend.
> Hmm, tricky one.  I agree with the argument for consistency, but on the 
> other hand you might also want a way to interrupt a computation 
> regardless, and that almost works - as long as the program isn't 
> discarding exceptions it knows nothing about.

In my mind this is, at least thematically, related to

that is, it relates to the various ways that running in ghci is 
different from running independently.

To get a really good answer I think we need a couple of RTS 
enhancements, the ability to have a kind 'supervisor' mode etc...


More information about the Glasgow-haskell-users mailing list