From 144d55a5becf73d2489880e025cc13fd59c7414b Mon Sep 17 00:00:00 2001 From: ismay <7355199+ismay@users.noreply.github.com> Date: Wed, 12 Jun 2024 06:56:20 +0200 Subject: [PATCH] [fish] Merge history before searching (#3852) Co-authored-by: Junegunn Choi --- shell/key-bindings.fish | 5 +++++ test/test_go.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index d1db09b..7f14c0d 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -62,6 +62,11 @@ function fzf_key_bindings set -l FISH_MAJOR (echo $version | cut -f1 -d.) set -l FISH_MINOR (echo $version | cut -f2 -d.) + # merge history from other sessions before searching + if test -z "$fish_private_mode" + builtin history merge + end + # history's -z flag is needed for multi-line support. # history's -z flag was added in fish 2.4.0, so don't use it for versions # before 2.4.0. diff --git a/test/test_go.rb b/test/test_go.rb index 6675f77..a26d440 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -66,7 +66,7 @@ class Shell end def fish - "unset #{UNSETS.join(' ')}; FZF_DEFAULT_OPTS=\"--no-scrollbar --pointer '>' --marker '>'\" fish_history= fish" + "unset #{UNSETS.join(' ')}; rm -f ~/.local/share/fish/fzf_test_history; FZF_DEFAULT_OPTS=\"--no-scrollbar --pointer '>' --marker '>'\" fish_history=fzf_test fish" end end end