Skip to content

Add a keyboard shortcut for toggling thinking mode #4072

Closed

Description

@LarsArtmann

TL;DR: enabling/disabling thinking is only reachable through the command
palette (ctrl+p → type → enter); it has no key binding anywhere in the
keymap. I'd like a direct shortcut, wired the way ctrl+b toggles the
sidebar.

Problem

For models with CanReason and no ReasoningLevels (Anthropic-style),
the only way to flip thinking is the command palette:

  • internal/ui/dialog/commands.go:475 registers the command with an
    empty shortcut hint: NewCommandItem(..., "toggle_thinking", status+" Thinking Mode", "", ActionToggleThinking{}). Siblings show
    theirs: toggle_sidebar gets "ctrl+b" (commands.go:488),
    file_picker gets "ctrl+f" (commands.go:495).
  • ActionToggleThinking has exactly two references in the tree: the
    palette item and its handler (internal/ui/model/ui.go:2262). No key
    path reaches it.
  • internal/ui/model/keys.go has no thinking/reasoning binding at all —
    quit, help, commands, models, sessions, yolo, sidebar, pills/tasks,
    details all have keys; thinking does not.

So every flip is ctrl+p, type "think", enter. Trading depth for speed
turn-by-turn (the workflow behind #2651) turns that into a lot of palette
trips.

Proposed change

Mirror the ToggleSidebar pattern (keys.go:221-224):

  1. internal/ui/model/keys.go: add Chat.ToggleThinking key.Binding
    plus a DefaultKeyMap entry.
  2. internal/ui/model/ui.go: key.Matches(msg, m.keyMap.Chat.ToggleThinking) next to the existing
    Chat.ToggleSidebar match (ui.go:3098), dispatching to the same
    code as the palette action, and add the binding to mainBinds
    (ui.go:4027) so it works while the editor is focused.
  3. internal/ui/dialog/commands.go:475: pass the binding's key as the
    shortcut argument instead of "" so the palette shows it.

Safe to hit mid-run: the toggle is not busy-gated and applies on the next
turn via updateAgentModelCmd (ui.go:2262), same as the model and
effort pickers.

Scope: only meaningful where the palette item already appears (CanReason
with no ReasoningLevels, commands.go:470); a no-op elsewhere is fine.
Models with reasoning levels have the effort dialog instead — out of
scope here. The specific key is yours to pick; as of a48dabea plain
ctrl+h/ctrl+u/ctrl+w look unbound in the main view.

All line numbers are against upstream main @ a48dabea (2026-10-14).

💘 Generated with Crush

Activity

  1. andrinoff commented on Oct 21, 2026

    @andrinoff
    Member

    Moving this to a discussion, thank you!

  2. locked and limited conversation to collaborators on Oct 21, 2026
  3. converted this issue into a discussion #4110 on Oct 21, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions