Skip to content

Fix quoting completions with trailing spaces - #388

Merged
kelleyma49 merged 3 commits into
kelleyma49:masterfrom
ReKylee:fix/completion-trailing-space
Sep 20, 2026
Merged

kelleyma49 merged 3 commits into
kelleyma49:masterfrom
ReKylee:fix/completion-trailing-space

Conversation

@ReKylee

@ReKylee ReKylee commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Some completers, including Carapace, include a trailing separator in CompletionText. PSFzf currently passes that separator through FixCompletionResult, which makes an otherwise simple completion look like it contains whitespace and causes it to be quoted.

Strip one trailing space or tab before quoting. PSFzf already appends its own separator after processing, so this avoids quoting the separator while preserving whitespace that is part of the actual completion value.

For example, build now becomes build instead of "build " , while my file still becomes "my file" .

Fixes #386

@ReKylee
ReKylee force-pushed the fix/completion-trailing-space branch from 9d5b8e9 to 995eae2 Compare September 19, 2026 14:57
@kelleyma49
kelleyma49 merged commit 7e9871d into kelleyma49:master Sep 20, 2026
3 checks passed
@kelleyma49

Copy link
Copy Markdown
Owner

Merged. Thank you for your contribution!

Copilot AI mentioned this pull request Sep 20, 2026
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.

PSFzf wrongly quotes completions with trailing space

2 participants