Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't escape environment variable in completion #39

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading