feat(hooks): make the finder keybinding configurable - #77
Merged
Merged
Conversation
Add [shell] keybinding config (default ^R) that templatizes the shell integration hooks. zsh uses caret notation directly; bash values are converted to \C-x form. "none"/empty drops the binding entirely. Closes #76
Wire the new [shell] keybinding key into 'tth config' so it can be read and written like other keys, and show it (plus theme.name) in the config listing.
Rewrite the caret-notation conversion so Alt/Meta (^[) and full escape sequences (e.g. ^[[1;6D for Ctrl-Shift-Left) render correctly in both zsh and bash, not just single Ctrl-<letter> chords.
Parse human combinations like ctrl+r, alt+x, and ctrl+shift+left into the right terminal sequence for zsh and bash, and default to ctrl+r. Raw caret notation still works for anything the parser doesn't cover.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #76. The finder keybinding was hardcoded to
Ctrl-Rin the shell hooks; now it is configurable.[shell] keybindingconfig option (caret notation, default"^R").shells/thoth.zsh,shells/thoth.bash) are templatized with a__THOTH_KEYBIND__placeholder thattth initsubstitutes at render time.bindkeyuses caret notation directly; bash'sbind -xvalues are converted to\C-xform."none"or an empty value drops the binding line entirely, letting the user bind_tth_widgetthemselves.Ctrl-R, so existing setups are unchanged.Acceptance criteria
Ctrl-Rwhen the option is absent.tth init zsh/tth init bashemit the configured binding.none/empty disables the binding.Testing
cargo test --lib(640 passed)tth init {zsh,bash}with default,^T, andnoneconfigs.