Fix issue with re-binding resh

pull/169/head v2.7.16
Simon Let 4 years ago
parent 5161c03874
commit 2799a51376
No known key found for this signature in database
GPG Key ID: D650C65DD46D431D
  1. 11
      scripts/reshctl.sh
  2. 6
      scripts/shellrc.sh

@ -10,12 +10,15 @@ __resh_nop() {
}
__resh_bind_control_R() {
bindfunc --revert '\C-r' __resh_widget_control_R_compat
if [ "${__RESH_control_R_bind_enabled-0}" != 0 ]; then
echo "RESH SEARCH app Ctrl+R binding is already enabled!"
return 1
# Re-binding is a valid usecase but it shouldn't happen much
# so this is a warning
echo "Re-binding RESH SEARCH app to Ctrl+R ..."
else
# Only save original binding if resh binding was not enabled
__RESH_bindfunc_revert_control_R_bind=$_bindfunc_revert
fi
bindfunc --revert '\C-r' __resh_widget_control_R_compat
__RESH_bindfunc_revert_control_R_bind=$_bindfunc_revert
__RESH_control_R_bind_enabled=1
if [ -n "${BASH_VERSION-}" ]; then
# fuck bash

@ -73,6 +73,8 @@ __resh_set_xdg_home_paths
__resh_run_daemon
[ "$(resh-config --key BindControlR)" = true ] && __resh_bind_control_R
# block for anything we only want to do once per session
# NOTE: nested shells are still the same session
if [ -z "${__RESH_SESSION_ID+x}" ]; then
@ -90,7 +92,5 @@ if [ -z "${__RESH_INIT_DONE+x}" ]; then
__resh_reset_variables
[ "$(resh-config --key BindControlR)" = true ] && __resh_bind_control_R
__RESH_INIT_DONE=1
fi
fi
Loading…
Cancel
Save