[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Completion: menu-complete from second TAB hit onwards
From:       Julien Duval <juduve () yahoo ! fr>
Date:       2009-09-30 16:55:39
Message-ID: 25685058.post () talk ! nabble ! com
[Download RAW message or body]


Thanks for the quick reply Chet.

I should have insisted on the fact that I don't want the first TAB to insert
a full match. The first TAB should only insert the longest common prefix
between all the possible completions (not a full match). A full match should
only be inserted from the second TAB hit.

Let's say I have the following files in the current working directory:
aaaaaa aaabbb aaaccc.
Then if I type 'cat a<TAB>' at the prompt, I should get a list of all the
possible completions and the longest common prefix inserted (that is 'aaa').
With menu-complete, 'aaaaaa' would be inserted, which is a full match, not
the common prefix. If I press TAB one more time, then 'aaaaaa' should be
inserted.

Hope it is a bit clearer.

Cheers,
Julien


Chet Ramey wrote:
> 
> > I'm trying to get a specific completion behaviour (simple but effective).
> > Any help would be greatly appreciated.
> > Here is what I'm looking for:
> > 
> > 1. When TAB is hit once, complete the command-line with the longest
> > common
> > prefix AND list all possible completions (at the same time).
> > This can be easily achieved by putting 'set show-all-if-ambiguous' in
> > ~/.inputrc.
> > 
> > 2. If TAB is hit again after that, then cycle through the possible
> > completions (that is insert the next full match each time TAB is
> > pressed).
> > Obviously, I cannot bind TAB to menu-complete cause I would lose 1.
> 
> Menu-complete in bash-4.0/readline-6.0 does this.
> 
> 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/
> 
> 
> 
> 

-- 
View this message in context: \
http://www.nabble.com/Completion%3A-menu-complete-from-second-TAB-hit-onwards-tp25672712p25685058.html
 Sent from the Gnu - Bash mailing list archive at Nabble.com.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic