Skip to content

fix(completions): don't split command words on colons - #1048

Merged
HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
georglauterbach:fix/command-word-colon-splitting
Nov 7, 2026
Merged

HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
georglauterbach:fix/command-word-colon-splitting

Conversation

@georglauterbach

@georglauterbach georglauterbach commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Words like namespace::function_name were split at every :, so completing a command whose name contains colons only ever saw the fragment after the last colon. Keep the first word of a command intact, while still splitting a leading VAR=value assignment so its value gets completed.

Splitting on : and = now also honors COMP_WORDBREAKS instead of being hardcoded, falling back to Bash's default when it is unset.

Closes #1046

CC @HalFrgrd

Words like `namespace::function_name` were split at every `:`, so
completing a command whose name contains colons only ever saw the
fragment after the last colon. Keep the first word of a command intact,
while still splitting a leading `VAR=value` assignment so its value gets
completed.

Splitting on `:` and `=` now also honors `COMP_WORDBREAKS` instead of
being hardcoded, falling back to Bash's default when it is unset.
@HalFrgrd

HalFrgrd commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thanks!

@HalFrgrd
HalFrgrd merged commit ad6ee50 into HalFrgrd:master Nov 7, 2026
7 checks passed
@georglauterbach
georglauterbach deleted the fix/command-word-colon-splitting branch November 7, 2026 15:58
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.

[BUG]: command names containing colons are not completed properly

2 participants