In my bash I got the behavior like this: when I type:

cd ~/projects/p   <press tab>

the bash extends the ~ part to the full name of my home dir:

cd /home/kender/projects/p

I remember it wasn't happening some time ago. Is that configurable in bash?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

Most probably you're now using /etc/bash_completion – check if it's loaded by your profile or bashrc.

It contains a function _expand which replaces the tilde by the path “to avoid problems when $cur starting with a tilde is fed to commands and ending up quoted instead of expanded” (from the comments in the function).

If you still want to keep the tilde, you could have a look at the _filedir function. Close to the top there's the line

_expand || return 0

Remove it or disable it with a # prefix. This is a ugly hack, however, and you might run into the problems mentioned above.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.