|
From: | Blake McBride |
Subject: | Re: [Bug-apl] Another attention signal issue |
Date: | Mon, 21 Jul 2014 13:12:05 -0500 |
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 ^C
s (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.
Hi David,
I see. The problem is that the line input (readline) does not return even
though I tell it to (by setting rl_done in the signal handler for ^C). I haven't
found a way to fix this (hints more than welcome). This could also be caused
by terminal settings ("cooked mode") but I thought readline would handle this.
Long term I will most likely replace readline because so far it has created more problems
than it has helped. That would be a bigger issue and should also be aligned with Elias'
emacs mode. So it would be after the next GNU APL release.
/// Jürgen
On 07/21/2014 06:32 PM, David B. Lamkins wrote:
Thanks, Jüergen. The real issue, from my perspective, is that APL doesn't report the ATTENTION message until it sees a newline on input. It seems to me that typing a ^C should immediately suspend execution and show the ATTENTION message. On Mon, 2014-07-21 at 18:23 +0200, Juergen Sauermann wrote:Hi David, I have changed readline to display a new line right after ^C, see SVN 382. For reasons that I don't fully understand, the next character after ^C will be eaten by readline; I tried a number of things to prevent this but haven't succeeded. I believe readline will be one of the next things removed from GNU APL. /// Jürgen On 07/21/2014 02:32 AM, David Lamkins wrote:When the session is not executing APL code, the attention signal is not handled until the next newline. To see this, enter the characters Control-C, 1, Return. -- "The secret to creativity is knowing how to hide your sources." Albert Einstein http://soundcloud.com/davidlamkins http://reverbnation.com/lamkins http://reverbnation.com/lcw http://lamkins-guitar.com/ http://lamkins.net/ http://successful-lisp.com/
[Prev in Thread] | Current Thread | [Next in Thread] |