From 58b2855513e8b24df4e4158ad4b87363ced1bef8 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 22 Mar 2026 09:19:54 +0900 Subject: [PATCH] bash: Fix CTRL-R batch deletion 'echo {+1}' would paste multiple offsets in a line. Fix #4730 --- shell/key-bindings.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 8d6548cb..e62291ac 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -96,7 +96,7 @@ if command -v perl > /dev/null; then set +o pipefail builtin fc -lnr -2147483648 | last_hist=$(HISTTIMEFORMAT='' builtin history 1) command perl -n -l0 -e "$script" | - FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --bind 'shift-delete:execute-silent(echo {+1} >> \"$deletefile\")+exclude-multi' --multi ${FZF_CTRL_R_OPTS-} --read0") \ + FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --bind 'shift-delete:execute-silent(cat {+f1} >> \"$deletefile\")+exclude-multi' --multi ${FZF_CTRL_R_OPTS-} --read0") \ FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) --query "$READLINE_LINE" ) __fzf_history_delete "$deletefile" @@ -123,7 +123,7 @@ else # awk - fallback for POSIX systems set +o pipefail builtin fc -lnr -2147483648 2> /dev/null | # ( $'\t '$'\n' )* ; ::= [^\n]* ( $'\n' )* __fzf_exec_awk "$script" | # ( $'\t'$'\000' )* - FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --bind 'shift-delete:execute-silent(echo {+1} >> \"$deletefile\")+exclude-multi' --multi ${FZF_CTRL_R_OPTS-} --read0") \ + FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --bind 'shift-delete:execute-silent(cat {+f1} >> \"$deletefile\")+exclude-multi' --multi ${FZF_CTRL_R_OPTS-} --read0") \ FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) --query "$READLINE_LINE" ) __fzf_history_delete "$deletefile"