Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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