Repository navigation
completion: Cleanup of Bash completion - #6710
Merged
Merged
Conversation
swick
approved these changes
Jun 18, 2026
A few global variables were being created unecessarily still. This makes sure that users shell environments are not polluted by extra variables and that the completion doesn't modify unrelated variables
1. Use $() command substitution instead of legacy `` style 2. Properly quote COMPGEN_OPTS 3. Use readarray instead of relying on word splitting
1. Removed unnecessary punctuation to help with readability 2. Loop over RES elements directly instead of indexing 3. Declare COMPGEN_OPTS only once vs redeclaring on each iteration
electricbrass
force-pushed
the
bash-completion-fix
branch
from
June 18, 2026 10:19
e0f638e to
4ecf8ad
Compare
swick
enabled auto-merge
June 18, 2026 10:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the cleanup and bugfix parts only of #6678. I've split them off into a separate PR so that the fixes don't have to wait on my other PRs that don't actually matter to them.
All shellcheck warnings have been addressed, and 2 fixes have been made:
i,RESandCURare now local instead of global to prevent modifying user's shell session's stateCOMPGEN_OPTSis properly quoted, which is needed for the filters passed tocompgen -Xto be interpreted bycompgeninstead of directly by Bash when expandingCOMPGEN_OPTS. This makes completion forflatpak installnot just error out whenfailglobis enabled, and has the filter actually correctly match.flatpakand.flatpakreffiles in all cases.Screencast.From.2026-06-08.21-39-53.mp4