bug-bash
[Top][All Lists]
Advanced

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

Re: How does one disable completion when nothing but tabs or spaces is o


From: Chet Ramey
Subject: Re: How does one disable completion when nothing but tabs or spaces is on the line?
Date: Sat, 05 Jan 2013 22:19:25 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 1/5/13 9:08 PM, Chet Ramey wrote:

>>    "I also noticed bash doesn't recognize META-key sequences in vi-mode.
>>    Yet it does recognize ESC-prefixed cursor-key sequences as not being 
>> "ESC",
>>    but I should likely address that in a separate email so as not to confuse
>>    the issue."
> 
> I'll take a look at the meta-key sequences (by which I assume you mean
> keys whose value is > 127) issue with vi-insert mode.

I didn't have any trouble binding these (as long as you force convert-meta
to off), but now I don't think that's what you're talking about.

> There is an intra-character timeout in current readline versions that does
> what I think you are talking about.  That is what allows readline to
> distinguish between, say, ESC meaning to go into vi commandm mode, and
> ESC-TAB meaning to perform word completion.

Bash-4.2/readline-6.2 has a non-settable timeout that allows readline to
distinguish between an ESC as a command to switch to vi command mode and
an ESC-prefixed key sequence.  The development versions make it a user-
settable variable (keyseq-timeout).

The following inputrc lets me use ESC-TAB for completion and TAB as TAB
using the development version of bash:

set convert-meta on

set keymap vi-insert
META-TAB:complete
TAB:self-insert

It will probably work with bash-4.2 if you can configure your terminal
emulator to convert meta keys to an escape-prefixed key sequence.  (The
Terminal application on Mac OS X lets me use the option key this way,
and it works there.)

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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