PDA

View Full Version : Backslash in bash tab completion: is it a bug or a feature?



MeMooMeM
January 20th, 2010, 08:39 PM
Hi everyone,

Try this:

cd $

and hit Tab. This causes a blackslash to appear before the dollar sign, which is really annoying, especially when trying to change directory to a folder name that is kept as an environmental variable, e.g. $THEFOLDERFOO.

Any ideas to disable this? Is this really necessary for reasons that I cannot think of? Thanks!

Simian Man
January 20th, 2010, 08:40 PM
Any ideas to disable this? Is this really necessary for reasons that I cannot think of?

Use ZSH instead?

wmcbrine
January 20th, 2010, 09:14 PM
I'm not getting a backslash.

MadCow108
January 20th, 2010, 09:39 PM
it must be configurable somewhere
it occurs on a machine at work with bash 3.1 but not on another one with 3.0
and not on my home pc with 4.0

but I'm to lazy to look up where to change it :)

sinbadbuddha
January 21st, 2010, 03:48 AM
When I tried it, it output a list of environment variables, as expected. You might want to update bash, though. Still, I can't think for the life of me why this would be a problem.

Anyway, I wouldn't call it a bug; it is just the way your version of bash does tab completion, i.e it completes file names, unescaped '$' signs are not allowed in files, so it escapes special characters before searching for them, and although not finding any files beginning with '$' in the path, it 'completes' anyway.