Skip to content

feat(hooks): make the finder keybinding configurable - #77

Merged
JoseVelazcoH merged 5 commits into
developfrom
feat/configurable-keybinding
Jul 5, 2026
Merged

JoseVelazcoH merged 5 commits into
developfrom
feat/configurable-keybinding

Conversation

@JoseVelazcoH

Copy link
Copy Markdown
Owner

Summary

Resolves #76. The finder keybinding was hardcoded to Ctrl-R in the shell hooks; now it is configurable.

  • New [shell] keybinding config option (caret notation, default "^R").
  • Shell hooks (shells/thoth.zsh, shells/thoth.bash) are templatized with a __THOTH_KEYBIND__ placeholder that tth init substitutes at render time.
  • zsh's bindkey uses caret notation directly; bash's bind -x values are converted to \C-x form.
  • "none" or an empty value drops the binding line entirely, letting the user bind _tth_widget themselves.
  • Default stays Ctrl-R, so existing setups are unchanged.

Acceptance criteria

  • A config key controls the finder keybinding for both zsh and bash.
  • Default remains Ctrl-R when the option is absent.
  • tth init zsh / tth init bash emit the configured binding.
  • none/empty disables the binding.
  • README/docs document the option.
  • Tests cover custom, default, and disabled bindings.

Testing

  • cargo test --lib (640 passed)
  • Manual tth init {zsh,bash} with default, ^T, and none configs.

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.
@JoseVelazcoH JoseVelazcoH self-assigned this Jul 5, 2026
@JoseVelazcoH JoseVelazcoH added type: feature New feature or request type: test Testing related type: zsh zsh related type: bash bash related labels Jul 5, 2026
@JoseVelazcoH
JoseVelazcoH changed the base branch from main to develop July 5, 2026 22:21
@JoseVelazcoH
JoseVelazcoH merged commit b69a1b6 into develop Jul 5, 2026
5 checks passed
@JoseVelazcoH
JoseVelazcoH deleted the feat/configurable-keybinding branch July 5, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bash bash related type: feature New feature or request type: test Testing related type: zsh zsh related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(hooks): make the finder keybinding configurable

1 participant