Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] [carapace + fzf-tab] adds an extra backslash to file completion. #503

Open
mainendra opened this issue Jan 1, 2025 · 1 comment
Open
Labels
bug Something isn't working confirmed Bug that's been confirmed to exist question Further information is requested

Comments

@mainendra
Copy link

When using carapace in conjunction with fzf-tab, it inadvertently adds an extra backslash to escape spaces or parentheses.

: mv Hello\\ One\\ \\(Two\\)\\ \\[Three\\].mp3 test.mp3
zsh: no matches found: \(Two\)\

However, when using ** and pressing tab, the command is executed successfully.

mv Hello\ One\ \(Two\)\ \[Three\].mp3

Is there a way to resolve this issue either by updating the fzf configuration or the carapace configuration?

As per the developer of Carapace

Carapace does custom quoting with compadd -Q.
Fzf-tab probably does that as well (or adds them without -Q) without acknowledging they are already quoted.

@mainendra mainendra added the question Further information is requested label Jan 1, 2025
@Aloxaf Aloxaf added bug Something isn't working confirmed Bug that's been confirmed to exist labels Jan 8, 2025
@Aloxaf
Copy link
Owner

Aloxaf commented Jan 8, 2025

Confirmed.

_tst() {
  local -a displaysArr=('Hello One (Two) [Three].mp3')
  local -a valuesArr=('Hello\\ One\\ \\(Two\\)\\ \\[Three\\].mp3')
  _describe -t files files displaysArr valuesArr -Q -S ''
}

compdef _tst tst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed Bug that's been confirmed to exist question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants