[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] How to force GNU readline to call functions bound to
Re: [Bug-readline] How to force GNU readline to call functions bound to 'C-d' even when line is empty
Mon, 15 Jul 2013 13:13:09 -0500
Is there any way to change this behavior? At the very least, I would want to return the line immediately instead of inserting an eof and allowing more input (current behaviour)
On Jul 15, 2013 9:09 AM, "Chet Ramey" <address@hidden
On 7/14/13 6:13 PM, Mara Kim wrote:
> Hi bug-readline!
> I asked this question over on Stack Overflow
> but figured it would be a good idea to get some insight from the developers.
> I am trying to bind C-d to a function (specifically, setting an exit
> flag). It works, but only when the current line is not blank. It appears
> that this behaviour is specific to C-d, as I have no issues when I bind
> other keys.
It's specific to the termios `eof' character. If readline gets the tty
eof character on a blank line, it interprets it as eof and behaves
It's been this way at least as far back as readline-4.2, which was released
in 2001. I didn't look back any earlier.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/