Skip to content

feat: support custom keybindings via config (e.g. switching permission modes) #1524

Description

@yuanyuan06

Problem

Currently, switching permission modes (yolo / auto / manual) in the TUI requires typing slash commands like /yolo or /perm yolo. There is no keyboard shortcut for this, and the TUI does not support user-customizable keybindings.

Only a few shortcuts are hardcoded:

  • Shift+Tab — toggle Plan mode
  • Ctrl+G — external editor
  • Ctrl+S — inject input during streaming
  • Ctrl+O — collapse/expand tool output

Feature Request

Add a [keybindings] section to tui.toml (or a similar config mechanism) that allows users to define custom keyboard shortcuts for built-in actions, at minimum:

  • "switch-permission" — cycle through yolo / auto / manual
  • "toggle-yolo" — jump directly to yolo mode
  • "toggle-auto" — jump directly to auto mode
  • "toggle-plan" — toggle plan mode (currently Shift+Tab is hardcoded; should be overridable)

Example config:

[keybindings]
switch_permission = "ctrl+shift+y"
toggle_plan = "ctrl+shift+p"

Use Case

Power users frequently switch between permission modes during a session (e.g. yolo for known-safe batch tasks, manual for risky operations). A single keystroke is significantly faster than typing /yolo every time, especially in fast-paced workflows.

Additional Context

This is a quality-of-life improvement. The TUI already supports a few hardcoded shortcuts, so the infrastructure for keybinding dispatch exists — this request is about making it extensible and user-configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions