As you don't give example code I can only guess, but in general, calling readline from a signal handler is a bit iffy, as readline may be busy with its internal affairs (and hence in an inconsistent state) when the signal fires.
A simple technique would be to set a global variable
remember_to_do_something from the signal handler, and then check it's value in the main loop. To get this main loop to run outside readline itself you would have to use readline's alternate callback interface
which is not at all complicated to use.
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. It all seems to work normally until i try to type the same letter as the one before the ctrl+c. For example, if i write x^C, the signal handler calls one of the functions (i tried with all of them) and then in the new line i can start typing anything but the letter x. It only allows writing the letter x after multiple keypresses. I am not 100% sure if this is a bug or a just a wrong way of using those functions but i am just making sure.