On 1/8/21 7:17 PM, Cosmin Petrescu wrote:
Hello

      I was working with the Readline library on a linux basic shell and i found some unexpected behaviour with the unix_line_discard, kill_backward_line and kill_full_line functions. The program i am writing has a signal handler for ctrl+c and the purpose of it would be to "clear" the previous input considering that everything behind the ctrl+c is redundant.

If you try to call readline functions from a signal handler, in the middle
of readline handling the signal itsef, all bets are off. You can't reliably
do anything from a signal handler except set variables or call a small set
of signal-safe functions.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Reply via email to