You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a keyboard shortcut for toggling thinking mode #4072
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):
internal/ui/model/keys.go: add Chat.ToggleThinking key.Binding
plus a DefaultKeyMap entry.
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.
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).
Activity
andrinoff commentedon Oct 21, 2026
Moving this to a discussion, thank you!