bash-completion
bash-completion copied to clipboard
expansion of special vars (`TZ`, `LANG`, etc.) without export or declare?
Describe the feature/solution
Only recently I've noted that bash-completion provides completion of some "special" env vars via: https://github.com/scop/bash-completion/blob/15b74b1050333f425877a7cbd99af2998b95c476/bash_completion#L1257
However, that only seems to be the case after export or declare:
https://github.com/scop/bash-completion/blob/15b74b1050333f425877a7cbd99af2998b95c476/completions/export#L28
Not sure whether this would technically be even possible (I tried a few naive approaches, but they all failed ^^)... but could those vars also be exported without export or declare, probably not, cause the completion would need to find out whether the word is an assignment at all possibly places.
But if it were somehow possible, that would be nice, especially as LANG is often already declared and exported, so I typically just set it with the new value, without writing export or declare again.
If not easily possible, than don't hesitate to close this issue as wontfix.
Thanks, Chris.
Maintenance (please complete the following information)
Well I guess this part doesn't apply, since it's not a new program that shall be completed?
- [ ] This is a request for new completion
- [ ] Link to upstream project query about shipping the completion:
The variable names of the variable assignments and the command names appear in the same context. Bash 5.0 added complete -I that can be used for the command-name completions. Currently, bash-completion doesn't define complete -I completions, but it would be possible in principle, though I'm sure if any practical issues arise in implementing it.