bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Another attention signal issue


From: Juergen Sauermann
Subject: Re: [Bug-apl] Another attention signal issue
Date: Tue, 22 Jul 2014 16:36:36 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Blake,

I tried, but it did not work.

The deeper I go into readline the more weird it gets.

If I do nothing then I get the first ^C delivered as signal but not subsequent ones.
I would have preferred if two ^Cs (i.e. INTERRUPT rather than ATTENTION) would
stop printouts, but readline delivers only one.

I also tried binding to ^C; interestingly I can bind to any other key except ^C. The
bind to ^C succeeds (returns no error) but the function bound to it is not
called. For other keys this works.

/// Jürgen


On 07/21/2014 08:12 PM, Blake McBride wrote:
Does this help?

This may be related to the cooked/uncooked/rare terminal modes; ^C does not always send a signal. It seems likely that readline uncooks the terminal, and thus any signals caused by keyboard input must be due to logic within readline itself; it seems plausible that it might only trigger a SIGINT on two sequential ^Cs (especially since for many programs that utilise readline such as shells and REPLs, the program exiting on a single ^C would be very annoying!).

You might be able to change this behaviour by using the readline API to rebind ^C to some of your own code that triggers a SIGINT. I haven't used readline from Haskell, just from C, so I'm not sure exactly how you'd go about this, but the binding seems rich enough to achieve it.



Blake McBride

www.arahant.com
Cell:    615-394-6760
Office:  615-376-5500
Fax:     615-377-6006




                  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]