[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 10:09:39 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
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/