Skip to content

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

@Ambrevar

Description

@Ambrevar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions