Pressing <tab> after typing 'export VARIABLE=~/' clobbers the 'VARIABLE='

309 views Asked by At

I'm experiencing the following behaviour in bash that I find very annoying:

  1. Type export VARIABLE=~/
  2. Now I'd like auto-completion for the next segment of the path, so I press <tab>.
  3. Bash clobbers the VARIABLE=, leaving just export ~/.

Why is this happening?

My bash version is 4.3.33, OS is Debian testing, terminal is Konsole.

1

There are 1 answers

2
rici On BEST ANSWER

Verify that $COMP_WORDBREAKS includes an =. If not, try this:

COMP_WORDBREAKS+==

If the export completion works to your satisfaction after that, then you need to figure out what startup file is changing COMP_WORDBREAKS.

For example, if you've installed node.js, the npm completion script (in /etc/bash_completions.d/npm removes = and @ from COMP_WORDBREAKS.

Many completion scripts, somewhat annoyingly, change global settings. (For example, the standard Debian/Ubuntu completion scripts enable the extglob shell option.)