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: Mara Kim
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 13:13:09 -0500

Hi Chet,

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)

Thanks,
Mara

On Jul 15, 2013 9:09 AM, "Chet Ramey" <address@hidden> wrote:
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]