Home » Questions » Computers [ Ask a new question ]

Bash shell tab completion, don't expand the ~

Bash shell tab completion, don't expand the ~

I use the Tab key a lot when I use the shell (bash).

Asked by: Guest | Views: 399
Total answers/comments: 2
Guest [Entry]

"Disabling tilde expansion is quick and painless. Open up ~/.bashrc and insert this:

_expand()
{
return 0;
}

This will override the expand function from /etc/bash_completion. I'd recommend commenting on what it does above the function in case you want the expansion back in the future. Changes will take effect in a new instance."
Guest [Entry]

"Even more compactly:

_expand() { :; }

...as "":"" is a shell built-in equivalent to ""true"" :-)"