summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Nelson <[email protected]>2025-12-18 15:30:01 +1100
committerGitHub <[email protected]>2025-12-17 22:30:01 -0600
commite789fcf5e513c74ea889dba14c7ff5a4c4c8f7c7 (patch)
tree9cc2ef247852801943b579c7d18d053d0fd08878
parentb9fb180bc66fef529cac346afb110098a6a531ac (diff)
downloadopencode-e789fcf5e513c74ea889dba14c7ff5a4c4c8f7c7.tar.gz
opencode-e789fcf5e513c74ea889dba14c7ff5a4c4c8f7c7.zip
feat(tui): add option to disable terminal title (#5713)
-rw-r--r--packages/opencode/src/cli/cmd/tui/app.tsx19
-rw-r--r--packages/opencode/src/config/config.ts1
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts4
-rw-r--r--packages/sdk/js/src/v2/gen/types.gen.ts4
4 files changed, 27 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx
index adccc4e10..028905fc3 100644
--- a/packages/opencode/src/cli/cmd/tui/app.tsx
+++ b/packages/opencode/src/cli/cmd/tui/app.tsx
@@ -176,13 +176,15 @@ function App() {
const exit = useExit()
const promptRef = usePromptRef()
+ const [terminalTitleEnabled, setTerminalTitleEnabled] = createSignal(kv.get("terminal_title_enabled", true))
+
createEffect(() => {
console.log(JSON.stringify(route.data))
})
// Update terminal window title based on current route and session
createEffect(() => {
- if (Flag.OPENCODE_DISABLE_TERMINAL_TITLE) return
+ if (!terminalTitleEnabled() || Flag.OPENCODE_DISABLE_TERMINAL_TITLE) return
if (route.data.type === "home") {
renderer.setTerminalTitle("OpenCode")
@@ -453,6 +455,21 @@ function App() {
process.kill(0, "SIGTSTP")
},
},
+ {
+ title: terminalTitleEnabled() ? "Disable terminal title" : "Enable terminal title",
+ value: "terminal.title.toggle",
+ keybind: "terminal_title_toggle",
+ category: "System",
+ onSelect: (dialog) => {
+ setTerminalTitleEnabled((prev) => {
+ const next = !prev
+ kv.set("terminal_title_enabled", next)
+ if (!next) renderer.setTerminalTitle("")
+ return next
+ })
+ dialog.clear()
+ },
+ },
])
createEffect(() => {
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts
index 73fc1c773..52fe478ee 100644
--- a/packages/opencode/src/config/config.ts
+++ b/packages/opencode/src/config/config.ts
@@ -559,6 +559,7 @@ export namespace Config {
session_child_cycle: z.string().optional().default("<leader>right").describe("Next child session"),
session_child_cycle_reverse: z.string().optional().default("<leader>left").describe("Previous child session"),
terminal_suspend: z.string().optional().default("ctrl+z").describe("Suspend terminal"),
+ terminal_title_toggle: z.string().optional().default("none").describe("Toggle terminal title"),
})
.strict()
.meta({
diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts
index 8d4550525..964112d81 100644
--- a/packages/sdk/js/src/gen/types.gen.ts
+++ b/packages/sdk/js/src/gen/types.gen.ts
@@ -950,6 +950,10 @@ export type KeybindsConfig = {
* Suspend terminal
*/
terminal_suspend?: string
+ /**
+ * Toggle terminal title
+ */
+ terminal_title_toggle?: string
}
export type AgentConfig = {
diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts
index 00f209c6d..fafdeb6d0 100644
--- a/packages/sdk/js/src/v2/gen/types.gen.ts
+++ b/packages/sdk/js/src/v2/gen/types.gen.ts
@@ -1110,6 +1110,10 @@ export type KeybindsConfig = {
* Suspend terminal
*/
terminal_suspend?: string
+ /**
+ * Toggle terminal title
+ */
+ terminal_title_toggle?: string
}
export type AgentConfig = {