From 85503fbc4b6026c616dd5dc8ebb4cfb82e1ef16c Mon Sep 17 00:00:00 2001 From: Patrick Fong Date: Mon, 6 Nov 2023 10:08:38 -0800 Subject: [PATCH] [Search History] fix unquoted regex in preview command Resolves #314. The problem was that the regex used to generate the preview was unquoted so fish interpreted it as a filename glob. I also fixed another potential bug by delinating the string replace command options from its arguments with --. --- functions/_fzf_search_history.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/_fzf_search_history.fish b/functions/_fzf_search_history.fish index 5adfa94..aea40bc 100644 --- a/functions/_fzf_search_history.fish +++ b/functions/_fzf_search_history.fish @@ -23,7 +23,7 @@ function _fzf_search_history --description "Search command history. Replace the --scheme=history \ --prompt="Search History> " \ --query=(commandline) \ - --preview="string replace --regex $time_prefix_regex '' {} | fish_indent --ansi" \ + --preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \ --preview-window="bottom:3:wrap" \ $fzf_history_opts | string split0 |