Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .