Skip to content

Commit 4387f9f

Browse files
authored
feat: Allow the function to hide or show thinking blocks to be bound to a key (resolves anomalyco#12168) (anomalyco#12171)
1 parent 31e2feb commit 4387f9f

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ export function Session() {
546546
{
547547
title: showThinking() ? "Hide thinking" : "Show thinking",
548548
value: "session.toggle.thinking",
549+
keybind: "display_thinking",
549550
category: "Session",
550551
slash: {
551552
name: "thinking",

packages/opencode/src/config/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ export namespace Config {
899899
terminal_suspend: z.string().optional().default("ctrl+z").describe("Suspend terminal"),
900900
terminal_title_toggle: z.string().optional().default("none").describe("Toggle terminal title"),
901901
tips_toggle: z.string().optional().default("<leader>h").describe("Toggle tips on home screen"),
902+
display_thinking: z.string().optional().default("none").describe("Toggle thinking blocks visibility"),
902903
})
903904
.strict()
904905
.meta({

packages/sdk/js/src/v2/gen/types.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,10 @@ export type KeybindsConfig = {
13091309
* Toggle tips on home screen
13101310
*/
13111311
tips_toggle?: string
1312+
/**
1313+
* Toggle thinking blocks visibility
1314+
*/
1315+
display_thinking?: string
13121316
}
13131317

13141318
/**

packages/web/src/content/docs/keybinds.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ OpenCode has a list of keybinds that you can customize through the OpenCode conf
9797
"history_next": "down",
9898
"terminal_suspend": "ctrl+z",
9999
"terminal_title_toggle": "none",
100-
"tips_toggle": "<leader>h"
100+
"tips_toggle": "<leader>h",
101+
"display_thinking": "none"
101102
}
102103
}
103104
```

0 commit comments

Comments
 (0)