1jehuang / 1jehuang/jcode

Add a keybinding to open the model picker

Open
#930 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no enhancement priority: low triage: needs-decision ux
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

The model picker is reachable only via the /model slash command (or Enter during
the onboarding ModelSelect phase). There is no keybinding to open it, unlike the
session picker (Alt+R / cmd+B).

Ctrl+Tab / Ctrl+Shift+Tab cycle models without opening the picker, which is not the
same as picking. Users want a key that opens the picker.

Why Ctrl+M is a safe choice (verified)

  • The TUI unconditionally pushes KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES
    at startup (crates/jcode-tui/src/tui/mod.rs:92-96), i.e. the kitty keyboard protocol.
  • Alacritty 0.13+ implements this protocol, so Ctrl+M arrives as CSI 109;5u ->
    KeyCode::Char('m') with CONTROL, distinct from KeyCode::Enter. Ctrl+P already
    works this way as the autopoke toggle, proving the path.
  • Routing is gated on modifiers.contains(CONTROL) (input.rs:2877), so a plain m
    still types normally.

Proposed implementation

  1. Add model_picker_open: String to KeybindingsConfig
    (crates/jcode-config-types/src/lib.rs:868) defaulting to "ctrl+m".
  2. Register it in the keybindings defaults (crates/jcode-config-types/src/keybindings.rs,
    jcode_bindings()) with a field path keybindings.model_picker_open, so the
    conflict checker (crates/jcode-setup-hints/src/keymap/conflicts.rs) picks it up.
  3. Wire it in handle_control_key (crates/jcode-tui/src/tui/app/input.rs:1791),
    mirroring the Ctrl+P arm:
    KeyCode::Char('m') => { app.open_model_picker(); true }
    
  4. Add the hotkey to the registry (crates/jcode-tui/src/tui/app/hotkey_feedback.rs,
    the Ctrl+P entry at line ~345) so it appears in help.

Caveat

If the kitty protocol fails to negotiate (e.g. Alacritty < 0.13), Ctrl+M collapses to
Enter and would collide. This is the same risk Ctrl+P already lives with; acceptable
but worth noting.

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 with KeybindingsConfig and jcode_bindings() in crates/jcode-config-types, then compare the Ctrl+P handling in crates/jcode-tui/src/tui/app/input.rs and its hotkey_feedback.rs registry entry. Check the conflict checker path and verify that Ctrl+M opens the model picker, appears in keyboard help, and leaves plain m behavior unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.