summaryrefslogtreecommitdiff
path: root/shell/key-bindings.fish
diff options
context:
space:
mode:
authorbitraid <bitraid@protonmail.ch>2025-01-28 14:34:21 +0200
committerGitHub <noreply@github.com>2025-01-28 21:34:21 +0900
commitcf2bb5e40ea68f3b41cc76a012266b134c59c5bf (patch)
treea18af6eca3a88958f44493808854ce3798132058 /shell/key-bindings.fish
parentf466e94d651e4ac4cd9c02c4477af38a3bebbd5f (diff)
downloadfzf-cf2bb5e40ea68f3b41cc76a012266b134c59c5bf.tar.gz
[fish] Improve fish binary path detection (#4208)
Instead of exporting a local `$SHELL` containing the location of fish in `$PATH` when global `$SHELL` is not fish, always set `--with-shell` with the actual binary path of fish that the function is running from.
Diffstat (limited to 'shell/key-bindings.fish')
-rw-r--r--shell/key-bindings.fish3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 18280a94..c66a2aa2 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -64,7 +64,8 @@ function fzf_key_bindings
set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line +m $FZF_CTRL_R_OPTS")
set -lx FZF_DEFAULT_OPTS_FILE ''
set -lx FZF_DEFAULT_COMMAND
- string match -q -r -- '/fish$' $SHELL; or set -lx SHELL (type -p fish)
+ set -a -- FZF_DEFAULT_OPTS --with-shell=(status fish-path)\\ -c
+
if type -q perl
set -a FZF_DEFAULT_OPTS '--tac'
set FZF_DEFAULT_COMMAND 'builtin history -z --reverse | command perl -0 -pe \'s/^/$.\t/g; s/\n/\n\t/gm\''