fzf-tab icon indicating copy to clipboard operation
fzf-tab copied to clipboard

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

Open mainendra opened this issue 11 months ago • 2 comments

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 avatar Jan 01 '25 04:01 mainendra

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

Aloxaf avatar Jan 08 '25 01:01 Aloxaf