Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expansion of special vars (TZ, LANG, etc.) without export or declare? #1058

Open
2 tasks
calestyo opened this issue Oct 4, 2023 · 1 comment
Open
2 tasks

Comments

@calestyo
Copy link
Contributor

calestyo commented Oct 4, 2023

Describe the feature/solution

Only recently I've noted that bash-completion provides completion of some "special" env vars via:

_comp_variable_assignments()

However, that only seems to be the case after export or declare:

_comp_variable_assignments "$cur" && return

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:
@akinomyoga
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants