antirez/linenoise

Cancel linenoise input on signal, I/O error, or close (read 0).

npat-efault opened this issue · 0 comments

If the user, when entering a line, presses C-c, the operation is canceled, and, effectivelly, linenoise() returns NULL. This is the correct behavior IMHO.

On the other hand, if, when entering a line, a signal is received or an input error is encountered, or if the channel is closed (read(2) returns 0), then linenoise() returns the partial line without any indication that something went wrong.

I think the following patch (or something along these lines) should be applied to correct this:

npat-efault/picocom@352ed00bc0