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

Already on GitHub? Sign in to your account

Escape and complete -C (for fzf completion widget) #3469

Open
Ambrevar opened this Issue Oct 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

Ambrevar commented Oct 17, 2016 edited

fish 2.3.1, Arch Linux, urxvt 9.22

I am trying to write a widget to replace fish completion menu with fzf. (Awesome, right? ;) )

The idea is simple:

## Boilerplate...
complete -C | fzf... | read result
## Some code to replace the token with $result.

Problem is, complete -C unescapes the tokens a bit too much, which makes variables indistinguishable from escaped dollars.

Example:

set HFOO 42
echo \$HOME-$H<binding>

Replace <binding> with a binding to a function that prints out complete -C. Result:

$HOME-$HOME
$HOME-$HFOO

The result is unusable since there is no way for the calling function to know what should be escaped.

The normal completion does preserve the escaped token though:

\$HOME-$HOME
\$HOME-$HFOO

I think complete -C should do the same.

This might be related to #1127.

@faho faho added the bug label Oct 19, 2016

@faho faho added this to the fish-future milestone Oct 19, 2016

Member

faho commented Oct 19, 2016

Yes, can reproduce.

We have a bunch of issues with escaping (because it's really confusing), but I can't find this particular one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment