lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Further to my message earlier about why I need to press Ctrl+C twice to
stop a Lua program that is blocked on I/O, such as

lua -e "io.stdin:read('*a')"

I see from lua.c that the problem is that because the signal can't be
delivered to a running Lua interpreter (because it can't restart
afterwards), it's deferred, and the second time I press Ctrl+C, the
program aborts.

Is there no way of doing things better than this? It hardly seems worth
catching SIGINT at all if I can't catch it when blocked on I/O...which is
the reason I most often want to escape from e.g. command line utils
(because I forgot to pass a file argument, and it's acting as a filter).

-- 
http://www.mupsych.org/~rrt/ | Floc: an egregiously good aperitif