Skip to content

Commit 457cec0

Browse files
committed
fix: don't escape environment variable in completion
1 parent 2ee5bee commit 457cec0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

functions/_fifc.fish

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ function _fifc
4747
# We use eval hack because wrapping source command
4848
# inside a function cause some delay before fzf to show up
4949
eval $cmd | while read -l token
50-
# string escape will escape '~' if present (at the begenning of path).
51-
# so we need to exclude it from escaping
50+
# don't escape '~' for path, `$` for environ
5251
if string match --quiet '~*' -- $token
5352
set -a result (string join -- "" "~" (string sub --start 2 -- $token | string escape))
53+
else if string match --quiet '$*' -- $token
54+
set -a result (string join -- "" "\$" (string sub --start 2 -- $token | string escape))
5455
else
5556
set -a result (string escape --no-quoted -- $token)
5657
end

0 commit comments

Comments
 (0)