Skip to content

docs: mecatui keybindings are configurable but undocumented #455

Closed

Description

@jbeda

Problem

mecatui has a complete operator keybinding-override mechanism, but it is documented nowhere — not in docs/tui.md (the page that bills itself as "the full mecatui reference: every keybinding") and not in user-docs/.

The feature that exists in code (and is tested):

  • cmd/mecatui/keymap/validator.go — Parse + Validate over an action→chords map, with scope-collision detection and bare-printable-rune rules.
  • cmd/mecatui/keymap_wiring_yaml.go — reads a keymap: map from operator-tier ~/.config/mecatl/settings.yaml (action name → comma-separated chords), overlays the repeatable --keymap Action=chord[,chord2] CLI flag (CLI wins per-action), validates, feeds ui.Deps.KeyOverrides.
  • cmd/mecatui/ui/keys.go — keyMap struct + applyKeyOverrides, guarded by keys_test.go which fails if any keyMap field lacks an override setter.

A concrete, currently-undocumented use case: reclaim ctrl+a / ctrl+e for the input box's line-start / line-end editing. The bubbles textarea already binds LineStart: home/ctrl+a and LineEnd: end/ctrl+e internally, but mecatui's onIdleKey switch intercepts ctrl+a (Agents overlay) and ctrl+e (Effort picker) before the keystroke reaches the textarea. Remapping Agents/Effort off those chords frees them — but an operator can't discover that without reading the source.

What "done" looks like

  1. user-docs/ — extend what-you-get/mecatui.md with a "Remapping keys" section: the keymap: override schema with a worked example (remapping Agents/Effort so ctrl+a/ctrl+e reach the input), both surfaces (YAML + the --keymap CLI flag, CLI wins per-action), the collision/validation rules in plain language, and the action-map vs textarea-internal-bindings distinction. Note settings are read once at startup — restart to apply (live reload is mecatui: live-reload operator settings (keymap) without restart #456).
  2. docs/tui.md — add the keybinding-override reference section: the full default-action table (every action, default chord(s), scope, what it does), the textarea-internal editing bindings (read from the bubbles textarea KeyMap), the override schema (both surfaces) and the validation rules. Make the page's "every keybinding" claim true.
  3. Help-overlay liveness fix (code) — the ? keys-&-features overlay (cmd/mecatui/ui/help.go) renders only some chords live from the keyMap (agentsKey, jumpKey); the rest are hardcoded literals (ctrl+e, ctrl+o/r/p, ctrl+t, alt+m, ctrl+v, and the rebindable enter/shift+enter). After a remap the overlay would still show the old chord. Introduce a helpKeys markings struct built once on the Model (m.helpKeyMarkings()), pass it into helpBody/renderHelpOverlay, and replace the literals so the overlay never lies after a remap. Non-rebindable rows (esc, /, ?, ctrl+c, etc.) stay literals.
  4. Follow website/CLAUDE.md: content-root-relative .md links, keep sidebar_position, task site:build as the broken-link gate, task docs to regenerate llms.txt before committing.

Explicitly out of scope

Notes

Activity

  1. added
    tui
    on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions