Current-Users archive

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

Re: editline doesn't allow ^C binding



Christos Zoulas <christos <at> astron.com> writes:

> EL_SIGNAL does not do what you think it does. It merely handles resetting
> the state of the terminal to normal before passing control of the signal to
> the regular handler.
> 
> You need to issue a setty command to unset Control-C from being the interrupt
> character, otherwise the tty driver grabs it before libedit gets a chance to
> see it:
> 
>       setty -d intr=^@
>

Thanks for that. One thing still confuses me though. If I do this on
the command line for the examples/test program, then everything works. If I call

el_set (el, EL_SETTY, "-d", "intr=^@", NULL);

immediately after the EL_SIGNAL command then this doesn't work? Even more
curiously, in my application if I call el_set as above it doesn't work until I
have entered at least one carriage return, and then it does start working from
that point on. This suggests that the command I am calling in C is doing the
right thing, but somehow I must refresh the editline object to get the updated
tty. My application somehow does that after a carriage return has been
processed, but examples/test never does?

thanks,

dan.



Home | Main Index | Thread Index | Old Index