I'm wondering if that particular bit of code (from 2004) is still useful.
This is only for Windows. The patch that creates this file is from 2004
(all the other patches that touch this file are cosmetic):
~~~
patch 414b6bb1fc853cfc6c853160dd7c7d473b50548f
Author: peter@zarquon.se
Date: Sat Aug 21 20:35:33 -03 2004
* Handle ctrl-c in a win32 console
This only works under a "pure" windows console, not in a cygwin shell
or mingw's rxvt (I don't know why..)
The invokation in Lock.lhs is a bit of a hack(ifdefs, ExitException..),
you might want to do that differently...
Due to the way SetConsoleCtrlHandler works, the threaded rts in ghc
must be
used under windows, and is enabled by this patch.
~~~
Also see Darcs.Util.SignalHandler where this code is used.
Relevant online resource on this topic:
*
https://neilmitchell.blogspot.com.ar/2015/05/handling-control-c-in-haskell.html
*
https://www.reddit.com/r/haskell/comments/36tjca/neil_mitchells_haskell_blog_handling_controlc_in/
|