disable autocomplete of the home path ( possible clues)

Rares Vernica rvernica at gmail.com
Fri Feb 9 19:09:11 UTC 2007


Peter Garrett wrote:
> On Wed, 07 Feb 2007 16:29:27 +0100
> Carsten Aulbert <carsten at welcomes-you.com> wrote:
> 
>> Rares Vernica wrote:
>>> In Bash, when I type something like "~/" and I press TAB, the "~" is 
>>> replaced with the path to my home (e.g. "/home/username"). I would like 
>>> to turn this feature off. Is it possible?
>> That is a yes
>>
>>> I don't want to turn off the other auto-completion features, like 
>>> directory and file names auto-completion, just the "~" replacement.
>> That's the harder part. My guess is, it belongs to the readline interface
>> Thus putting 'set tilde-expand Off' in ~/.incputrc *should* alter that,
>> according to 'man bash' or 'man readline', however, I didn't succeed.
>>
>> Maybe you should search in that direction.
> 
> OK - I did a bit of comparison with a Debian Sid chroot I have running
> here, and discovered the following:
> 
> 1: Debian does not complete the tilde on ~/ <tab> ( for instance  cd ~/deb
> <tab> does not expand to /home/peter/debs but remains ~/debs )
> 
> 2. Debian sets the PATH in /etc/profile and does not
> source /etc/bash.bashrc from /etc/profile
> 
> 3. Apparently Ubuntu uses /etc/environment to set the PATH
> 
> 4. If the following is commented out in /etc/profile on Ubuntu, it behaves
> like Debian ( no tilde expansion)
> 
> #    if [ -f /etc/bash.bashrc ]; then
> #	. /etc/bash.bashrc
> #    fi
> 
> This appears not to affect the PATH , which is set for users
> in /etc/environment in Ubuntu for reasons which remain triumphantly
> unclear to me ;-) Something to do with pam ??
> 
> Commenting those lines in /etc/profile might break other things in new and
> entertaining ways of which I am unaware ;-) , but this seems to be at
> least a clue.
> 
>  /etc/bash.bashrc has a function which is *supposed* to
> enable tilde expansion, but commenting that function out had no apparent
> effect here.
> 
> Peter
> 

It works.

Thanks a lot,
Ray





More information about the ubuntu-users mailing list