hotfix to preserve ctrl+R config during updates

config doesn't survive updates but ctrl+R does
pull/92/head v2.5.19
Simon Let 6 years ago
parent bbfc036223
commit 21360960aa
  1. 6
      cmd/config/main.go
  2. 19
      scripts/install.sh

@ -40,6 +40,12 @@ func main() {
printBoolNormalized(config.BindArrowKeysZsh)
case "bindcontrolr":
printBoolNormalized(config.BindControlR)
case "port":
fmt.Println(config.Port)
case "sesswatchperiodseconds":
fmt.Println(config.SesswatchPeriodSeconds)
case "sesshistinithistorysize":
fmt.Println(config.SesshistInitHistorySize)
default:
fmt.Println("Error: illegal --key!")
os.Exit(1)

@ -112,11 +112,24 @@ echo "Copying files ..."
cp -f submodules/bash-preexec/bash-preexec.sh ~/.bash-preexec.sh
cp -f submodules/bash-zsh-compat-widgets/bindfunc.sh ~/.resh/bindfunc.sh
cp -f conf/config.toml ~/.config/resh.toml
cp -f scripts/shellrc.sh ~/.resh/shellrc
cp -f scripts/reshctl.sh scripts/widgets.sh scripts/hooks.sh scripts/util.sh ~/.resh/
# hotfix to not overwrite enabled ctrl+R binding in config
bindcontrolr=0
if [ "$(bin/resh-config -key bindcontrolr)" = true ]; then
# control_R binding is enabled
bindcontrolr=1
fi
cp -f conf/config.toml ~/.config/resh.toml
# hotfix part2 (ctrl+R)
if [ "$bindcontrolr" = 1 ]; then
# reenable ctrl+R binding if it was enabled before
bin/resh-control enable ctrl_r_binding_global >/dev/null 2>/dev/null
fi
echo "Generating completions ..."
bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl
bin/resh-control completion zsh > ~/.resh/zsh_completion.d/_reshctl
@ -172,7 +185,7 @@ __resh_run_daemon
echo "
echo "
##########################################################
# #
# SUCCESS - thank you for trying out this project! #

Loading…
Cancel
Save