Bash variable expansion on tab complete Bash variable expansion on tab complete bash bash

Bash variable expansion on tab complete


Found the bug report, please register (if not already registered) and add yourself to the 'people affected' list, I just did:

https://bugs.launchpad.net/ubuntu/+source/bash/+bug/778627

Workarounds

Try enabling direxpand or cdable_vars:

shopt -s direxpand# orshopt -s cdable_vars

Apparently EscTab might be a workaround:

I haven't found a proper solution to this, but there's a workaround. The escaping of environment variables can be disabled by pressing Esc followed by tab.

# cd $SO + [Esc] + [Tab]# cd $SOME_DIR

Confirm that as a bug! I just confirmed that the same thing works on

No LSB modules are available.Distributor ID: UbuntuDescription:    Ubuntu 10.10Release:        10.10Codename:       maverick

I get broken behaviour on (up-to-date) natty:

No LSB modules are available.Distributor ID: UbuntuDescription:    Ubuntu 11.04Release:    11.04Codename:   natty

Although I must add that I do not the slash escaped, but the path (while valid, existing, accessible and readable) is not getting expanded.

Info: https://help.ubuntu.com/community/ReportingBugs


The bug report refered to in other answers at bugs.launchpad.net gives a new workaround by issuing the command:

shopt -s direxpand

It works for me.


I was having a similar problem in cygwin (NT-6.1 2.0.1 2015-04-30) bash (GNU 4.3.33), especially when I would try to tab-expand a path that contained spaces.

I put shopt -s direxpand in my ~/.bashrc. Problem solved.