Skip to content

Commit

Permalink
fix: don't escape environment variable in completion
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen committed Apr 7, 2024
1 parent 2ee5bee commit 457cec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions/_fifc.fish
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ function _fifc
# We use eval hack because wrapping source command
# inside a function cause some delay before fzf to show up
eval $cmd | while read -l token
# string escape will escape '~' if present (at the begenning of path).
# so we need to exclude it from escaping
# don't escape '~' for path, `$` for environ
if string match --quiet '~*' -- $token
set -a result (string join -- "" "~" (string sub --start 2 -- $token | string escape))
else if string match --quiet '$*' -- $token
set -a result (string join -- "" "\$" (string sub --start 2 -- $token | string escape))
else
set -a result (string escape --no-quoted -- $token)
end
Expand Down

0 comments on commit 457cec0

Please sign in to comment.