[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Trapping Control-C in an interactive Lua program
- From: Brett Nash <nash@...>
- Date: Mon, 12 Apr 2010 17:10:15 +0800
On Mon, 12 Apr 2010 10:51:13 +0200
steve donovan <steve.j.donovan@gmail.com> wrote:
> Hi all,
>
> This is ultimately not a Lua-specific problem, but here we go:
> sometimes you need an interactive Lua program that doesn't quietly die
> on control-C.
>
> I've tried using SetConsoleCtrlHandler(nil,1) and
> signal(SIGINT,SIG_IGN) using Alien, and no go.
>
> Obviously I could change lua.c to get the behaviour I need, but
> naturally I would prefer not to.
>
> steve d.
I think you need to take a look at:
http://www.cons.org/cracauer/sigint.html
It describes the correct solution, but you will need to either do alien
magic or modify lua (the later would be preferable).
Regards,
nash