Skip to content

fix(completions): bash colon completion boundaries - #31

Merged
zerosnacks merged 4 commits into
masterfrom
feat/fix-bash-colon-complete-boundaries
Sep 13, 2026
Merged

zerosnacks merged 4 commits into
masterfrom
feat/fix-bash-colon-complete-boundaries

Conversation

@zerosnacks

Copy link
Copy Markdown
Member

Summary

Backport Usage 6.9.0's Bash completion fix for colon-separated values.

Bash Readline may treat : as a word boundary through COMP_WORDBREAKS, while Argx completes against the full logical argument. This meant Argx could generate the correct full candidate but Bash would replace only the fragment after the final breaking colon, producing incorrect insertion.

Changes

  • pass Bash's current Readline word and COMP_WORDBREAKS through the private completion protocol
  • preserve the distinction between breaking colons and quoted or escaped colons
  • determine the prefix Readline will keep during replacement
  • report that prefix through the private completion response
  • strip the preserved prefix from candidates before populating COMPREPLY
  • add regression coverage for normal, escaped, quoted, consecutive, and trailing escaped colon cases

The implementation follows the Usage 6.9.0 fix closely, with only the mechanical changes required for Argx's existing completion protocol and lint configuration.

Parser semantics and completion behavior for other shells are unchanged.

Backport Usage 6.9.0s Bash completion fix for colon-separated values.

Preserve the distinction between breaking colons and colons kept inside
quoted or escaped words, pass Bashs current Readline word and
COMP_WORDBREAKS through the private completion protocol, and report the
prefix Readline will preserve during replacement.

Strip that preserved prefix from generated candidates before populating
COMPREPLY so colon-separated completions insert only the fragment Bash
is actually replacing.

Add regression coverage for normal, escaped, quoted, consecutive, and
trailing escaped colon cases.
…selemis-com/argx into feat/fix-bash-colon-complete-boundaries
@zerosnacks
zerosnacks enabled auto-merge (squash) September 13, 2026 10:34
@zerosnacks
zerosnacks merged commit bf9ceed into master Sep 13, 2026
11 checks passed
@zerosnacks
zerosnacks deleted the feat/fix-bash-colon-complete-boundaries branch September 13, 2026 10:34
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

Successfully merging this pull request may close these issues.

1 participant