bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] key bindings proposal


From: Chet Ramey
Subject: Re: [Bug-readline] key bindings proposal
Date: Thu, 2 Jun 2016 14:23:10 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.0

On 5/20/16 2:25 PM, address@hidden wrote:

> What I envisioned was a facility to execute external commands, not
> alternate-keymap macros. This would be needed in order to get a
> solution which applies to all readline applications, not just Bash. I
> was thinking that in addition to normal ~/.inputrc bindings like
> 
> "\e[1;5C": forward-word
> 
> and macros like
> 
> "\ex": 'cd !$ \015ls\015'
> 
> Readline could also support some syntax like
> 
> "\C-x\C-w": `x-clip-kill-region`

I understand your proposal, and agree that your proposed syntax is probably
the most straightforward.

However, this requires fairly extensive changes to readline.  The bash
approach, while bash-specific, uses existing readline features and yet
has already uncovered some holes in readline's support for things like
this.  This is why I wrote that I wouldn't mind seeing another
implementation outside readline proper that would uncover any remaining
holes in readline's support.

> It could update the value of these variables by outputting e.g.
> "READLINE_POINT=...\0READLINE_LINE=...\0" on STDOUT (or whatever is
> easiest to parse).

This is probably a non-starter.  To parse this optional output, readline
would have to run the command with its standard output, at least,
connected to a pipe to readline and handle displaying all the command's
output.  Many commands change their behavior based on whether they're
writing to a pipe.

Bash is able to do this because it can execute commands without creating
a child process.

-- 
``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]