Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

My os is ubuntu 11.10. In the terminal when i input cp $HOME/ then type TAB. It will change to cp \$HOME/ and won't give any hint about what's in this directory.
But in vim, it will work just as i want. I heard that vim is using zsh instead of bash.

share|improve this question

migrated from Feb 21 '12 at 11:56

This question came from our site for professional and enthusiast programmers.

Probably the $ is escaped, not expanded. – user17383 Feb 21 '12 at 11:46
This is a new "feature" which I've seen appear in Ubuntu since 11.10. Before that, it would expand $HOME as soon as you pressed TAB. But I have no solution. – Aaron Digulla Feb 21 '12 at 11:48
Vim is not using any shell, vim has it's own completion implementation. – Jan Hudec Feb 21 '12 at 11:49
Try with zsh. It has many nice extra features compared to bash. – Jan Hudec Feb 21 '12 at 11:50
up vote 3 down vote accepted

It's a bug: In natty, bash completion now quotes shell variable references rather than expanding them

See comment #7 for a workaround or this forum post: Bash auto-complete of environment variables - Comment #7

share|improve this answer
Obviously, it's the best answer. But i am wondering how do you find it. Do you often check launchpad? Thank you. – Frank Cheng Feb 22 '12 at 9:12
Nope. I just did a couple of searches using keywords that I found in the forum post. That turned up the bug report. – Aaron Digulla Feb 23 '12 at 8:25

Your Answer


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.