nushell / nushell/reedline

Chord keybindings: one shared resolver over a trie

Open
#1,204 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

#989 and #1016 went after multi-key bindings so the combined design lives here.

  • Storage: a trie in Keybindings keyed by KeyCombination, as in #989.
    A key may be both a binding and a prefix (j -> Down, jj -> Esc).
  • Recogniser: one SequenceResolver in edit_mode that each mode embeds, as in #1016 but written once.
    The mode only supplies the fallback, e.g. vi insert self-inserts a lone j once the sequence dies.
  • Timeout: the pending sequence flushes on the engine side, since only the engine sees time pass.
  • Tests: through the vi harness, an emacs counterpart, and the four cases: completes, times out, strict prefix, binding-and-prefix.

Config shape on the nushell side and f<char> style capture are follow-ups.

Thanks @reubeno and @benvansleen for the two halves.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Keybindings and the edit_mode entry points, then trace how the vi harness currently handles key sequences. Verify the shared resolver against the vi harness, an emacs counterpart, and the four stated cases: completion, timeout, strict prefix, and a binding that is also a prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.