Skip to content

Commit 1bc3014

Browse files
authored
Merge pull request #39 from phanen/fix/env-escape
fix: don't escape environment variable in completion
2 parents b2ac36e + 457cec0 commit 1bc3014

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
@@ -48,10 +48,11 @@ function _fifc
4848
# We use eval hack because wrapping source command
4949
# inside a function cause some delay before fzf to show up
5050
eval $cmd | while read -l token
51-
# string escape will escape '~' if present (at the begenning of path).
52-
# so we need to exclude it from escaping
51+
# don't escape '~' for path, `$` for environ
5352
if string match --quiet '~*' -- $token
5453
set -a result (string join -- "" "~" (string sub --start 2 -- $token | string escape))
54+
else if string match --quiet '$*' -- $token
55+
set -a result (string join -- "" "\$" (string sub --start 2 -- $token | string escape))
5556
else
5657
set -a result (string escape --no-quoted -- $token)
5758
end

0 commit comments

Comments
 (0)