From cf2bb5e40ea68f3b41cc76a012266b134c59c5bf Mon Sep 17 00:00:00 2001 From: bitraid Date: Tue, 28 Jan 2025 14:34:21 +0200 Subject: [PATCH] [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. --- shell/key-bindings.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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\''