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

I am experiencing the following behavior in bash, which I find very annoying:

  • A type export VARIABLE=~/

  • Now I would like to autocomplete for the next segment of the path, so I click <tab>

    .
  • Bash clobbers VARIABLE=

    , leaving only export ~/

    .

Why is this happening?

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

+3


source to share


1 answer


Make sure it $COMP_WORDBREAKS

contains =

. If not, try this:

COMP_WORDBREAKS+==

      

If export

your satisfaction is satisfied after the completion of the work , you need to find out which startup file is changing COMP_WORDBREAKS

.



For example, if you installed node.js, completing the npm

script (in will /etc/bash_completions.d/npm

remove =

and @

from COMP_WORDBREAKS.

Many completion scripts, somewhat annoyingly, change global settings. (For example, standard Debian / Ubuntu shutdown scripts allow a shell option extglob

.)

+6


source







All Articles