help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Capture tab in a readline.


From: Chet Ramey
Subject: Re: [Help-bash] Capture tab in a readline.
Date: Tue, 22 Aug 2017 08:51:08 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 8/22/17 12:30 AM, Sinbad wrote:
> Hi Pierre,
> 
> Thanks for the reply. Yes i want to implement my own completion, for that i
> need to detect tab, i tried '-d' option as
> well, it doesn't work either. Actually i have been looking for a solution
> for this for quite a while now. I'm surprised
> there is no easy way to do this. If this doesn't work then i will have to
> switch to either python or perl, but i'd like to
> stick to bash if there is a way to do it.

Pierre gave you the answer:

>> 3) since you use -e, pressing tab will not insert a "TAB" character,
>> instead it will try to complete, to be able to input a tab
>> you will need to press "control-v" then a TAB

Tab already has a key binding (completion) that will be active when you
call readline. If you don't want that binding to be active, you either
need to override it (bind tab to self-insert) or ensure that it doesn't
get invoked (use ^V for quoted-insert as Pierre describes).

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



reply via email to

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