bug-bash
[Top][All Lists]
Advanced

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

Re: How to change the command completion behavior in bash


From: Chet Ramey
Subject: Re: How to change the command completion behavior in bash
Date: Tue, 17 Nov 2009 15:00:08 -0500
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Peng Yu wrote:
> On Mon, Nov 16, 2009 at 4:50 AM, Henning Garus
> <henning.garus@googlemail.com> wrote:
>> On Sun, Nov 15, 2009 at 08:31:38PM -0600, Peng Yu wrote:
>>> If I have the following in the command line,
>>>
>>> ~/.bash
>>>
>>> when I type <TAB>, it will become /home/my_user_name/.bash
>>>
>>> I'm wondering if it is possible to configure bash command completion,
>>> so that it will still be '~/.bash'
>>>
>> Add
>>
>> set expand-tilde off
>>
>> to your ~/.inputrc . However off is the default value, so you could
>> try to find out where it is set to on and remove that.
>>
>> See "Readline Variables" in man bash.
> 
> I add
> 
> set expand-tilde off
> 
> to my ~/.inputrc. Then I login again.
> 
> Then I type the following after bash prompt
> 
> cd ~
> 
> Later, if I type <TAB> after ~, ~ still expands to the abspath of my
> home directory. I'm confused why 'set expand-tilde off' does not
> change the behavior of bash.

If you have a programmable completion specfied for `cd', that takes
precedence.  You can find your programmable completions by typing
`complete -p' and the specific programmable completion for cd by typing
`complete -p cd'.  I'll bet that completion is performing tilde expansion.

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]