bug-readline
[Top][All Lists]
Advanced

[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


From: Chet Ramey
Subject: Re: [Bug-readline] How to force GNU readline to call functions bound to 'C-d' even when line is empty
Date: Mon, 15 Jul 2013 10:09:39 -0400
User-agent: 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
> (http://stackoverflow.com/questions/17608865/how-to-force-gnu-readline-to-call-bound-functions-when-line-is-blank),
> 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
accordingly.

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.

Chet
-- 
``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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]