diff --git a/Makefile b/Makefile index 0a86aa2..c3ad5d8 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,8 @@ GOFLAGS=-ldflags "-X main.version=${VERSION} -X main.commit=${REVISION}" build: submodules bin/resh-session-init bin/resh-collect bin/resh-postcollect bin/resh-daemon\ bin/resh-evaluate bin/resh-sanitize bin/resh-control bin/resh-config bin/resh-inspect bin/resh-cli -install: build conf/config-dev.toml +install: build scripts/install.sh - # Dev config - # cp -f conf/config-dev.toml ~/.config/resh.toml test_go: # Running tests diff --git a/README.md b/README.md index 7fd42c4..7de4ca6 100644 --- a/README.md +++ b/README.md @@ -59,17 +59,18 @@ Imagine being able to search your shell history based on both the command itself - :heavy_check_mark: search by keywords - :heavy_check_mark: relevant results show up first based on context (host, directory, git, exit status) - :heavy_check_mark: allow searching completely without context ("raw" mode) - - :white_check_mark: include a help page with keybindings and onboarding in the app - - :x: import and search history from before RESH was installed + - :heavy_check_mark: import and search history from before RESH was installed + - :white_check_mark: include a help with keybindings - :x: allow listing details for individual commands - :x: allow explicitly searching by metadata - :white_check_mark: Provide bindings for arrow keys - - :heavy_check_mark: imitate default behaviour - - :heavy_check_mark: save additional metadata (e.g. command was recalled using arrow keys) + - :heavy_check_mark: imitate default behaviour (serve recent history) + - :heavy_check_mark: built-in prefix search + - :heavy_check_mark: serve fully dedupicated history - :x: use arrow down for easy sequence repeating - :heavy_check_mark: zsh - - :white_check_mark: bash *(performance issues)* + - :white_check_mark: bash *(off by deafult because of bash performance issues)* - :heavy_check_mark: Provide a `reshctl` utility to control and interact with the project - :heavy_check_mark: turn on/off resh key bindings @@ -125,47 +126,47 @@ Check for updates and update reshctl update ``` -### RESH CLI tool +### RESH SEARCH application -RESH CLI searches your history by commands. It uses host, directories, git remote, and exit status to show you relevant results first. +RESH SEARCH app searches your history by commands. It uses host, directories, git remote, and exit status to show you relevant results first. -All this context is not in the regular shell history. RESH CLI will only search shell history that was recorded after you install this project. +All this context is not in the regular shell history. RESH records shell history with context to use it when searching. -*I use RESH CLI everyday but please remember that it is still a prototype.* +At first, the search application will look something like this. Some history with context and most of it without. As you can see, you can still search the history just fine. -![resh cli](img/screen-resh-cli-v2-6.png) +![resh search app](img/screen-resh-cli-v2-7-init.png) -Without query, RESH CLI shows you the latest history based on the current context (host, directory, git). +Eventually most of your history will have context and RESH SEARCH app will get more useful. -![resh cli](img/screen-resh-cli-v2-6-no-query.png) +![resh search app](img/screen-resh-cli-v2-7.png) -RESH CLI tool can be bound to ctrl+R (recommended) or executed directly. +Without a query, RESH SEARCH app shows you the latest history based on the current context (host, directory, git). -Enable/disable ctrl+R binding for THIS shell session: +![resh search app](img/screen-resh-cli-v2-7-no-query.png) -```sh -reshctl enable ctrl_r_binding -reshctl disable ctrl_r_binding -``` +RESH SEARCH app replaces the standard reverse search - launch it using Ctrl+R. -Enable/disable for FUTURE shell sessions: +Enable/disable the Ctrl+R keybinding: ```sh -reshctl enable ctrl_r_binding_global -reshctl disable ctrl_r_binding_global +reshctl enable ctrl_r_binding +reshctl disable ctrl_r_binding ``` -Run the RESH CLI tool as a one-off: +You can also run the RESH SEARCH app directly as a one-off: ```sh resh ``` +NOTE: One feature is not available when running RESH SEARCH app directly - arrow right won't paste the selected command onto the command line for editing. + ### Arrow key bindings Resh provides arrow key bindings. -These bindings do regular stepping through history and prefix search. +These bindings provide regular stepping through history and prefix search. +They also fully deduplicate the served history. They allow resh to record bindings usage metadata. @@ -175,7 +176,7 @@ They allow resh to record bindings usage metadata. Arrow key bindings are enabled by default in zsh and they are disabled by default in bash because there are some performance issues. -Enable/disable arrow key bindings for THIS shell session: +Enable/disable arrow key bindings: ```sh reshctl enable arrow_key_bindings @@ -183,14 +184,6 @@ reshctl enable arrow_key_bindings reshctl disable arrow_key_bindings ``` -Enable/disable for FUTURE shell sessions: - -```sh -reshctl enable arrow_key_bindings_global - -reshctl disable arrow_key_bindings_global -``` - See what your current setting is: ```sh diff --git a/cmd/cli/item.go b/cmd/cli/item.go index b72a919..c8e2a9e 100644 --- a/cmd/cli/item.go +++ b/cmd/cli/item.go @@ -267,7 +267,7 @@ func properMatch(str, term, padChar string) bool { func newItemFromRecordForQuery(record records.CliRecord, query query, debug bool) (item, error) { // Use numbers that won't add up to same score for any number of query words const hitScore = 1.307 - const properMatchScore = 0.603 + const properMatchScore = 0.503 const hitScoreConsecutive = 0.002 // Host penalty diff --git a/cmd/cli/main.go b/cmd/cli/main.go index c5c337e..816249a 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -378,9 +378,9 @@ func (m manager) Layout(g *gocui.Gui) error { v.Editable = true v.Editor = m if m.s.rawMode { - v.Title = " RESH CLI - NON-CONTEXTUAL \"RAW\" MODE - (CTRL+R to switch BACK) " + v.Title = " RESH SEARCH - NON-CONTEXTUAL \"RAW\" MODE - (CTRL+R to switch BACK) " } else { - v.Title = " RESH CLI - CONTEXTUAL MODE - (CTRL+R to switch to RAW MODE) " + v.Title = " RESH SEARCH - CONTEXTUAL MODE - (CTRL+R to switch to RAW MODE) " } g.SetCurrentView("input") @@ -488,11 +488,12 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error { realLineLength := maxX - 2 printedLineLength := maxX - 4 statusLine := m.s.data[m.s.highlightedItem].drawStatusLine(compactRenderingMode, printedLineLength, realLineLength) - var statusLineHeight int = len(statusLine) + 1 // help line + var statusLineHeight int = len(statusLine) helpLineHeight := 1 const helpLine = "HELP: type to search, UP/DOWN to select, RIGHT to edit, ENTER to execute, CTRL+G to abort, CTRL+C/D to quit; " + - "TIP: when resh-cli is launched command line is used as initial search query" + "FLAGS: G = this git repo, E# = exit status #" + // "TIP: when resh-cli is launched command line is used as initial search query" mainViewHeight := maxY - topBoxHeight - statusLineHeight - helpLineHeight m.s.displayedItemsCount = mainViewHeight @@ -605,7 +606,7 @@ func SendCliMsg(m msg.CliMsg, port string) msg.CliResponse { client := &http.Client{} resp, err := client.Do(req) if err != nil { - log.Fatal("resh-daemon is not running :(") + log.Fatal("resh-daemon is not running - try restarting this terminal") } defer resp.Body.Close() diff --git a/cmd/control/cmd/enable.go b/cmd/control/cmd/enable.go index f065a6c..e9883a3 100644 --- a/cmd/control/cmd/enable.go +++ b/cmd/control/cmd/enable.go @@ -21,36 +21,26 @@ var enableCmd = &cobra.Command{ var enableArrowKeyBindingsCmd = &cobra.Command{ Use: "arrow_key_bindings", - Short: "enable bindings for arrow keys (up/down) FOR THIS SHELL SESSION", - Run: func(cmd *cobra.Command, args []string) { - exitCode = status.EnableArrowKeyBindings - }, -} - -var enableArrowKeyBindingsGlobalCmd = &cobra.Command{ - Use: "arrow_key_bindings_global", - Short: "enable bindings for arrow keys (up/down) FOR FUTURE SHELL SESSIONS", - Long: "Enable bindings for arrow keys (up/down) FOR FUTURE SHELL SESSIONS.\n" + + Short: "enable bindings for arrow keys (up/down)", + Long: "Enable bindings for arrow keys (up/down)\n" + "Note that this only affects sessions of the same shell.\n" + - "(e.g. running this in zsh will only affect future zsh sessions)", + "(e.g. running this in zsh will only enable the keybinding in zsh)", Run: func(cmd *cobra.Command, args []string) { exitCode = enableDisableArrowKeyBindingsGlobally(true) + if exitCode == status.Success { + exitCode = status.EnableArrowKeyBindings + } }, } var enableControlRBindingCmd = &cobra.Command{ Use: "ctrl_r_binding", - Short: "enable binding for control+R FOR THIS SHELL SESSION", - Run: func(cmd *cobra.Command, args []string) { - exitCode = status.EnableControlRBinding - }, -} - -var enableControlRBindingGlobalCmd = &cobra.Command{ - Use: "ctrl_r_binding_global", - Short: "enable bindings for control+R FOR FUTURE SHELL SESSIONS", + Short: "enable RESH-CLI binding for Ctrl+R", Run: func(cmd *cobra.Command, args []string) { exitCode = enableDisableControlRBindingGlobally(true) + if exitCode == status.Success { + exitCode = status.EnableControlRBinding + } }, } @@ -63,36 +53,26 @@ var disableCmd = &cobra.Command{ var disableArrowKeyBindingsCmd = &cobra.Command{ Use: "arrow_key_bindings", - Short: "disable bindings for arrow keys (up/down) FOR THIS SHELL SESSION", - Run: func(cmd *cobra.Command, args []string) { - exitCode = status.DisableArrowKeyBindings - }, -} - -var disableArrowKeyBindingsGlobalCmd = &cobra.Command{ - Use: "arrow_key_bindings_global", - Short: "disable bindings for arrow keys (up/down) FOR FUTURE SHELL SESSIONS", - Long: "Disable bindings for arrow keys (up/down) FOR FUTURE SHELL SESSIONS.\n" + + Short: "disable bindings for arrow keys (up/down)", + Long: "Disable bindings for arrow keys (up/down)\n" + "Note that this only affects sessions of the same shell.\n" + - "(e.g. running this in zsh will only affect future zsh sessions)", + "(e.g. running this in zsh will only enable the keybinding in zsh)", Run: func(cmd *cobra.Command, args []string) { exitCode = enableDisableArrowKeyBindingsGlobally(false) + if exitCode == status.Success { + exitCode = status.DisableArrowKeyBindings + } }, } var disableControlRBindingCmd = &cobra.Command{ Use: "ctrl_r_binding", - Short: "disable binding for control+R FOR THIS SHELL SESSION", - Run: func(cmd *cobra.Command, args []string) { - exitCode = status.DisableControlRBinding - }, -} - -var disableControlRBindingGlobalCmd = &cobra.Command{ - Use: "ctrl_r_binding_global", - Short: "disable bindings for control+R FOR FUTURE SHELL SESSIONS", + Short: "disable RESH-CLI binding for Ctrl+R", Run: func(cmd *cobra.Command, args []string) { exitCode = enableDisableControlRBindingGlobally(false) + if exitCode == status.Success { + exitCode = status.DisableControlRBinding + } }, } @@ -131,37 +111,24 @@ func enableDisableArrowKeyBindingsGlobally(value bool) status.Code { // I don't like the interface this function has - passing both config structure and a part of it feels wrong // It's ugly and could lead to future errors func setConfigBindArrowKey(configPath string, config *cfg.Config, configField *bool, shell string, value bool) error { - if *configField == value { - if value { - fmt.Println("The RESH arrow key bindings are ALREADY GLOBALLY ENABLED for all future " + shell + " sessions - nothing to do - exiting.") - } else { - fmt.Println("The RESH arrow key bindings are ALREADY GLOBALLY DISABLED for all future " + shell + " sessions - nothing to do - exiting.") - } - return nil - } - if value { - fmt.Println("ENABLING the RESH arrow key bindings GLOBALLY (in " + shell + ") ...") - } else { - fmt.Println("DISABLING the RESH arrow key bindings GLOBALLY (in " + shell + ") ...") - } - *configField = value + if *configField != value { + *configField = value - f, err := os.Create(configPath) - if err != nil { - fmt.Println("Error: Failed to create/open file:", configPath, "; error:", err) - return err - } - defer f.Close() - if err := toml.NewEncoder(f).Encode(config); err != nil { - fmt.Println("Error: Failed to encode and write the config values to hdd. error:", err) - return err + f, err := os.Create(configPath) + if err != nil { + fmt.Println("Error: Failed to create/open file:", configPath, "; error:", err) + return err + } + defer f.Close() + if err := toml.NewEncoder(f).Encode(config); err != nil { + fmt.Println("Error: Failed to encode and write the config values to hdd. error:", err) + return err + } } if value { - fmt.Println("SUCCESSFULLY ENABLED the RESH arrow key bindings GLOBALLY (in " + shell + ") " + - "- every new (" + shell + ") session will start with enabled RESH arrow key bindings!") + fmt.Println("RESH arrow key bindings: ENABLED (in " + shell + ")") } else { - fmt.Println("SUCCESSFULLY DISABLED the RESH arrow key bindings GLOBALLY (in " + shell + ") " + - "- every new (" + shell + ") session will start with " + shell + " default arrow key bindings!") + fmt.Println("RESH arrow key bindings: DISABLED (in " + shell + ")") } return nil } @@ -175,37 +142,24 @@ func enableDisableControlRBindingGlobally(value bool) status.Code { fmt.Println("Error reading config", err) return status.Fail } - if config.BindControlR == value { - if value { - fmt.Println("The RESH control+R binding is ALREADY GLOBALLY ENABLED for all future shell sessions - nothing to do - exiting.") - } else { - fmt.Println("The RESH control+R binding is ALREADY GLOBALLY DISABLED for all future shell sessions - nothing to do - exiting.") - } - return status.Fail - } - if value { - fmt.Println("ENABLING the RESH arrow key bindings GLOBALLY ...") - } else { - fmt.Println("DISABLING the RESH arrow key bindings GLOBALLY ...") - } - config.BindControlR = value + if config.BindControlR != value { + config.BindControlR = value - f, err := os.Create(configPath) - if err != nil { - fmt.Println("Error: Failed to create/open file:", configPath, "; error:", err) - return status.Fail - } - defer f.Close() - if err := toml.NewEncoder(f).Encode(config); err != nil { - fmt.Println("Error: Failed to encode and write the config values to hdd. error:", err) - return status.Fail + f, err := os.Create(configPath) + if err != nil { + fmt.Println("Error: Failed to create/open file:", configPath, "; error:", err) + return status.Fail + } + defer f.Close() + if err := toml.NewEncoder(f).Encode(config); err != nil { + fmt.Println("Error: Failed to encode and write the config values to hdd. error:", err) + return status.Fail + } } if value { - fmt.Println("SUCCESSFULLY ENABLED the RESH arrow key bindings GLOBALLY " + - "- every new shell session will start with enabled RESH CLI control+R binding!") + fmt.Println("RESH SEARCH app Ctrl+R binding: ENABLED") } else { - fmt.Println("SUCCESSFULLY DISABLED the RESH arrow key bindings GLOBALLY " + - "- every new shell session will start with your orignal control+R key binding!") + fmt.Println("RESH SEARCH app Ctrl+R binding: DISABLED") } return status.Success } diff --git a/cmd/control/cmd/root.go b/cmd/control/cmd/root.go index 492c9f4..c4ca933 100644 --- a/cmd/control/cmd/root.go +++ b/cmd/control/cmd/root.go @@ -43,15 +43,11 @@ func Execute(ver, com string) status.Code { rootCmd.AddCommand(enableCmd) enableCmd.AddCommand(enableArrowKeyBindingsCmd) - enableCmd.AddCommand(enableArrowKeyBindingsGlobalCmd) enableCmd.AddCommand(enableControlRBindingCmd) - enableCmd.AddCommand(enableControlRBindingGlobalCmd) rootCmd.AddCommand(disableCmd) disableCmd.AddCommand(disableArrowKeyBindingsCmd) - disableCmd.AddCommand(disableArrowKeyBindingsGlobalCmd) disableCmd.AddCommand(disableControlRBindingCmd) - disableCmd.AddCommand(disableControlRBindingGlobalCmd) rootCmd.AddCommand(completionCmd) completionCmd.AddCommand(completionBashCmd) diff --git a/cmd/inspect/main.go b/cmd/inspect/main.go index 2c5bc94..6474ed3 100644 --- a/cmd/inspect/main.go +++ b/cmd/inspect/main.go @@ -66,7 +66,7 @@ func SendInspectMsg(m msg.InspectMsg, port string) msg.MultiResponse { client := &http.Client{} resp, err := client.Do(req) if err != nil { - log.Fatal("resh-daemon is not running :(") + log.Fatal("resh-daemon is not running - try restarting this terminal") } defer resp.Body.Close() diff --git a/conf/config-dev.toml b/conf/config-dev.toml deleted file mode 100644 index 2c0031d..0000000 --- a/conf/config-dev.toml +++ /dev/null @@ -1,7 +0,0 @@ -port = 2627 -sesswatchPeriodSeconds = 120 -sesshistInitHistorySize = 1000 -debug = true -bindArrowKeysBash = false -bindArrowKeysZsh = true -bindControlR = true diff --git a/img/screen-resh-cli-v2-7-init.png b/img/screen-resh-cli-v2-7-init.png new file mode 100644 index 0000000..a63133c Binary files /dev/null and b/img/screen-resh-cli-v2-7-init.png differ diff --git a/img/screen-resh-cli-v2-7-no-query.png b/img/screen-resh-cli-v2-7-no-query.png new file mode 100644 index 0000000..cfeb60d Binary files /dev/null and b/img/screen-resh-cli-v2-7-no-query.png differ diff --git a/img/screen-resh-cli-v2-7.png b/img/screen-resh-cli-v2-7.png new file mode 100644 index 0000000..76da058 Binary files /dev/null and b/img/screen-resh-cli-v2-7.png differ diff --git a/pkg/collect/collect.go b/pkg/collect/collect.go index fd7d5a7..685b544 100644 --- a/pkg/collect/collect.go +++ b/pkg/collect/collect.go @@ -36,7 +36,7 @@ func SendRecallRequest(r records.SlimRecord, port string) (string, bool) { client := &http.Client{} resp, err := client.Do(req) if err != nil { - log.Fatal("resh-daemon is not running :(") + log.Fatal("resh-daemon is not running - try restarting this terminal") } defer resp.Body.Close() @@ -71,7 +71,7 @@ func SendRecord(r records.Record, port, path string) { client := &http.Client{} _, err = client.Do(req) if err != nil { - log.Fatal("resh-daemon is not running :(") + log.Fatal("resh-daemon is not running - try restarting this terminal") } } diff --git a/scripts/install.sh b/scripts/install.sh index 70cf564..085446d 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -193,64 +193,67 @@ fi __resh_run_daemon +info="---- Scroll down using arrow keys ---- +##################################### +# ____ _____ ____ _ _ # +# | _ \| ____/ ___|| | | | # +# | |_) | _| \___ \| |_| | # +# | _ <| |___ ___) | _ | # +# |_| \_\_____|____/|_| |_| # +# Rich Enhanced Shell History # +##################################### +" + +info="$info +RESH SEARCH APPLICATION = Redesigned reverse search that actually works + + >>> Launch RESH SEARCH app by pressing CTRL+R <<< + (you will need to restart your teminal first) + + Search your history by commands. + Host, directories, git remote, and exit status is used to display relevant results first. + + At first, the search application will use the standard shell history without context. + All history recorded from now on will have context which will by the RESH SEARCH app. + + Enable/disable Ctrl+R binding using reshctl command: + $ reshctl enable ctrl_r_binding + $ reshctl disable ctrl_r_binding + +ARROW KEY BINDINGS = Slightly better arrow key bindings for zsh + + Arrow keys behave as you are used to. Plus prefix search and the history is fully deduplicated. + They are enabled by default in zsh (and disabled in bash because they are slow in bash). + + Enable/disable arrow key bindings using reshctl command: + $ reshctl enable arrow_key_bindings + $ reshctl disable arrow_key_bindings + +CHECK FOR UPDATES + To check for (and install) updates use reshctl command: + $ reshctl update + +HISTORY + Your resh history will be recorded to '~/.resh_history.json' + Look at it using e.g. following command (you might need to install jq) + $ tail -f ~/.resh_history.json | jq + +ISSUES & FEEDBACK + Please report issues to: https://github.com/curusarn/resh/issues + Feedback and suggestions are very welcome! +" +if [ -z "${__RESH_VERSION:-}" ]; then info="$info + +############################################################## +# # +# Finish the installation by RESTARTING this terminal! # +# # +############################################################## +" +fi + +info="$info +---- Close this by pressing Q ----" + -echo " -########################################################## -# # -# SUCCESS - thank you for trying out this project! # -# # -########################################################## - - HISTORY - Your resh history will be recorded to '~/.resh_history.json' - Look at it using e.g. following command (you might need to install jq) - $ tail -f ~/.resh_history.json | jq - - Your default shell history will stay intact. - - SANITIZATION - In sanitized history, all sensitive information is replaced with its SHA256 hashes. - To get a sanitized version of your shell history run: - $ reshctl sanitize - - If you would consider supporting my research/thesis by giving me a sanitized version of your history then - please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98 - - ARROW KEY BINDINGS - Regular stepping through history and prefix search. There might be more features in the future. - They are enabled by default in zsh (and disabled in bash). - Enable/disable them using reshctl command: - $ reshctl enable ... / reshctl disable ... - - RESH CLI - SEARCH THE RECORDED HISTORY - RESH CLI searches your history by commands and directories. - - Directories are not in regular shell history. Because of that RESH CLI will only search shell history recorded by this project. - This means that you can enable RESH CLI now and use it as your history grows or you can wait for a little bit. - - Please remember that RESH CLI is still an early prototype. - - RESH CLI tool can be bound to ctrl+R (recommended) or executed directly. - - Enable/disable ctrl+R binding for THIS shell session: - $ reshctl enable ctrl_r_binding - $ reshctl disable ctrl_r_binding - - Enable/disable for FUTURE shell sessions: - $ reshctl enable ctrl_r_binding_global - $ reshctl disable ctrl_r_binding_global - - Run the RESH CLI tool as a one-off: - $ resh - - CHECK FOR UPDATES - To check for (and install) updates use: - $ reshctl update - - WARNING - It's recommended to RESTART all open terminal windows - - ISSUES & FEEDBACK - Please report issues to: https://github.com/curusarn/resh/issues - Feedback and suggestions are also very welcome! -" \ No newline at end of file +echo "$info" | less \ No newline at end of file diff --git a/scripts/reshctl.sh b/scripts/reshctl.sh index 750fc6d..b4aadc0 100644 --- a/scripts/reshctl.sh +++ b/scripts/reshctl.sh @@ -32,7 +32,7 @@ __resh_nop() { __resh_bind_control_R() { if [ "${__RESH_control_R_bind_enabled-0}" != 0 ]; then - echo "Error: Can't enable control R binding because it is already enabled!" + echo "Error: Can't enable Ctrl+R binding because it is already enabled!" return 1 fi bindfunc --revert '\C-r' __resh_widget_control_R_compat @@ -83,11 +83,11 @@ __resh_unbind_arrows() { __resh_unbind_control_R() { if [ "${__RESH_control_R_bind_enabled-0}" != 1 ]; then - echo "Error: Can't disable control R binding because it is not enabled!" + echo "Error: Can't disable Ctrl+R binding because it is not enabled!" return 1 fi if [ -z "${__RESH_bindfunc_revert_control_R_bind+x}" ]; then - echo "Warn: Couldn't revert control R binding because 'revert command' is empty." + echo "Warn: Couldn't revert Ctrl+R binding because 'revert command' is empty." else eval "$__RESH_bindfunc_revert_control_R_bind" fi @@ -109,7 +109,7 @@ __resh_unbind_all() { resh() { local buffer local git_remote; git_remote="$(git remote get-url origin 2>/dev/null)" - buffer=$(resh-cli --sessionID "$__RESH_SESSION_ID" --host "$HOST" --pwd "$PWD" --gitOriginRemote "$git_remote") + buffer=$(resh-cli --sessionID "$__RESH_SESSION_ID" --host "$__RESH_HOST" --pwd "$PWD" --gitOriginRemote "$git_remote") status_code=$? if [ $status_code = 111 ]; then # execute diff --git a/scripts/shellrc.sh b/scripts/shellrc.sh index cde8ff9..7b55f9b 100644 --- a/scripts/shellrc.sh +++ b/scripts/shellrc.sh @@ -89,14 +89,14 @@ if [ -z "${__RESH_INIT_DONE+x}" ]; then __resh_reset_variables if [ "$__RESH_SHELL" = bash ] ; then - [ "$(resh-config --key BindArrowKeysBash)" = true ] && reshctl enable arrow_key_bindings + [ "$(resh-config --key BindArrowKeysBash)" = true ] && __resh_bind_arrows elif [ "$__RESH_SHELL" = zsh ] ; then - [ "$(resh-config --key BindArrowKeysZsh)" = true ] && reshctl enable arrow_key_bindings + [ "$(resh-config --key BindArrowKeysZsh)" = true ] && __resh_bind_arrows else echo "RESH error: unknown shell (init)" echo "$__RESH_SHELL" fi - [ "$(resh-config --key BindControlR)" = true ] && reshctl enable ctrl_r_binding + [ "$(resh-config --key BindControlR)" = true ] && __resh_bind_control_R __RESH_INIT_DONE=1 fi diff --git a/scripts/widgets.sh b/scripts/widgets.sh index b66cd31..228d4dc 100644 --- a/scripts/widgets.sh +++ b/scripts/widgets.sh @@ -101,7 +101,7 @@ __resh_widget_control_R() { local status_code local git_remote; git_remote="$(git remote get-url origin 2>/dev/null)" - BUFFER=$(resh-cli --sessionID "$__RESH_SESSION_ID" --host "$HOST" --pwd "$PWD" --gitOriginRemote "$git_remote" --query "$BUFFER") + BUFFER=$(resh-cli --sessionID "$__RESH_SESSION_ID" --host "$__RESH_HOST" --pwd "$PWD" --gitOriginRemote "$git_remote" --query "$BUFFER") status_code=$? if [ $status_code = 111 ]; then # execute @@ -123,7 +123,7 @@ __resh_widget_control_R() { BUFFER="$PREVBUFFER" else echo "$BUFFER" >| ~/.resh/cli_last_run_out.txt - echo "# RESH cli failed - sorry for the inconvinience (error output was saved to ~/.resh/cli_last_run_out.txt)" + echo "# RESH SEARCH APP failed - sorry for the inconvinience (error output was saved to ~/.resh/cli_last_run_out.txt)" BUFFER="$PREVBUFFER" fi CURSOR=${#BUFFER}