Fix bash completion for COMP_WORDBREAKS characters like colon - #1907
Closed
yoshibase wants to merge 11 commits into
Closed
Fix bash completion for COMP_WORDBREAKS characters like colon#1907yoshibase wants to merge 11 commits into
yoshibase wants to merge 11 commits into
Conversation
Rebuild COMP_WORDS from COMP_LINE before dispatching to Typer and strip the wordbreak prefix from candidates so values like alpine:latest complete correctly instead of returning empty or duplicating alpine:.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
yoshibase
force-pushed
the
fix/issue-1905-bash-completion-wordbreaks
branch
from
July 24, 2026 16:38
5464a84 to
ce3f524
Compare
added 6 commits
July 24, 2026 09:42
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
Author
|
Tests are green after the COMP_WORDBREAKS harden follow-up. Could a maintainer please add the |
added 2 commits
July 24, 2026 15:26
Git Bash on Windows CI is detected as bash but does not exercise the compspec path the same way; the integration test is Unix-only.
Exercise the helper's defensive error path so aggregate CI coverage remains at 100 percent while the shell integration stays skipped on Windows.
svlandeg
reviewed
Jul 27, 2026
svlandeg
left a comment
Member
There was a problem hiding this comment.
Closing as per the contribution guidelines.
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.
Summary
Fixes #1905.
Bash splits
COMP_WORDSonCOMP_WORDBREAKS(including:) before the compspec runs, so values likealpine:latestarrived as separate tokens and completion saw the wrongincompleteprefix.Changes
Updated
COMPLETION_SCRIPT_BASHintyper/_completion_shared.pyto:COMP_LINE/COMP_POINTbefore calling TyperCOMP_WORDBREAKS-delimited suffix from each candidate before inserting intoCOMPREPLY(so bash appendslatestafteralpine:instead of replacing withalpine:latest)COMP_WORDBREAKSand helper failures so the compspec does not abort mid-completionTest plan
pytest tests/test_completion/test_completion_bash_wordbreaks.pypytest tests/test_completion/(full suite)COMP_WORDS=(prog --name : l)withCOMP_LINE="prog --name alpine:l"completes toalpine:latestLabel request: this is a bug fix — please add the
buglabel socheck-labelscan pass (contributors cannot set it).