From 5ccc7f4fd931ec978079eb522d1d4ee3118a0b9a Mon Sep 17 00:00:00 2001 From: Simon Let Date: Mon, 17 Feb 2020 14:54:05 +0100 Subject: [PATCH] fix ctrl_R widget shadowing the bash_preexec hook --- scripts/widgets.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/widgets.sh b/scripts/widgets.sh index 257a6c8..335cadb 100644 --- a/scripts/widgets.sh +++ b/scripts/widgets.sh @@ -88,6 +88,12 @@ __resh_widget_arrow_down() { __resh_helper_arrow_post } __resh_widget_control_R() { + # this is a very bad workaround + # force bash-preexec to run repeatedly because otherwise premature run of bash-preexec overshadows the next poper run + # I honestly think that it's impossible to make widgets work in bash without hacks like this + # shellcheck disable=2034 + __bp_preexec_interactive_mode="on" + # local __RESH_PREFIX=${BUFFER:0:CURSOR} # __RESH_HIST_RECALL_ACTIONS="$__RESH_HIST_RECALL_ACTIONS;control_R:$__RESH_PREFIX" local PREVBUFFER=$BUFFER