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. 17
      scripts/install.sh

@ -40,6 +40,12 @@ func main() {
printBoolNormalized(config.BindArrowKeysZsh) printBoolNormalized(config.BindArrowKeysZsh)
case "bindcontrolr": case "bindcontrolr":
printBoolNormalized(config.BindControlR) printBoolNormalized(config.BindControlR)
case "port":
fmt.Println(config.Port)
case "sesswatchperiodseconds":
fmt.Println(config.SesswatchPeriodSeconds)
case "sesshistinithistorysize":
fmt.Println(config.SesshistInitHistorySize)
default: default:
fmt.Println("Error: illegal --key!") fmt.Println("Error: illegal --key!")
os.Exit(1) 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-preexec/bash-preexec.sh ~/.bash-preexec.sh
cp -f submodules/bash-zsh-compat-widgets/bindfunc.sh ~/.resh/bindfunc.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/shellrc.sh ~/.resh/shellrc
cp -f scripts/reshctl.sh scripts/widgets.sh scripts/hooks.sh scripts/util.sh ~/.resh/ 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 ..." echo "Generating completions ..."
bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl
bin/resh-control completion zsh > ~/.resh/zsh_completion.d/_reshctl bin/resh-control completion zsh > ~/.resh/zsh_completion.d/_reshctl

Loading…
Cancel
Save