Repository navigation
Add a keyboard shortcut for toggling thinking mode #4110
LarsArtmann
started this conversation in
Ideas
Replies: 1 comment
|
Moving this to a discussion, thank you! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: enabling/disabling thinking is only reachable through the command
palette (
ctrl+p→ type → enter); it has no key binding anywhere in thekeymap. I'd like a direct shortcut, wired the way
ctrl+btoggles thesidebar.
Problem
For models with
CanReasonand noReasoningLevels(Anthropic-style),the only way to flip thinking is the command palette:
internal/ui/dialog/commands.go:475registers the command with anempty shortcut hint:
NewCommandItem(..., "toggle_thinking", status+" Thinking Mode", "", ActionToggleThinking{}). Siblings showtheirs:
toggle_sidebargets"ctrl+b"(commands.go:488),file_pickergets"ctrl+f"(commands.go:495).ActionToggleThinkinghas exactly two references in the tree: thepalette item and its handler (
internal/ui/model/ui.go:2262). No keypath reaches it.
internal/ui/model/keys.gohas 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 speedturn-by-turn (the workflow behind #2651) turns that into a lot of palette
trips.
Proposed change
Mirror the
ToggleSidebarpattern (keys.go:221-224):internal/ui/model/keys.go: addChat.ToggleThinking key.Bindingplus a
DefaultKeyMapentry.internal/ui/model/ui.go:key.Matches(msg, m.keyMap.Chat.ToggleThinking)next to the existingChat.ToggleSidebarmatch (ui.go:3098), dispatching to the samecode 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 theshortcut 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 andeffort pickers.
Scope: only meaningful where the palette item already appears (
CanReasonwith 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
a48dabeaplainctrl+h/ctrl+u/ctrl+wlook unbound in the main view.All line numbers are against upstream
main@a48dabea(2026-10-14).💘 Generated with Crush
All reactions