bash-completion
bash-completion copied to clipboard
Make work with `localvar_inherit` set
When shopt -s localvar_inherit
(bash 5.0) is enabled and there is a global variable mode
, local mode
initializes the variable mode
with the value of the global mode
, and thus [[ ${mode-} ]]
will always success unexpectedly. I think local mode
should be explicitly initialized with some value. The condition [[ ! -v mode ]]
also needs to be updated.
Originally posted by @akinomyoga in https://github.com/scop/bash-completion/pull/642#discussion_r757770921
See the discussion thread there for more info and thoughts.