summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorGoni Zahavy <[email protected]>2025-11-22 20:48:23 +0200
committerGitHub <[email protected]>2025-11-22 12:48:23 -0600
commit6afdb5c0e554589c2033fded26894d7f4e37eb58 (patch)
tree7030dd9726dfa767939fc355248a0707a4afde25 /packages
parentbdcf864678cc79679d65acebd053b3e2b1b7d0c5 (diff)
downloadopencode-6afdb5c0e554589c2033fded26894d7f4e37eb58.tar.gz
opencode-6afdb5c0e554589c2033fded26894d7f4e37eb58.zip
tui: added ctrl-z terminal suspension support (#3983)
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/tui/app.tsx15
-rw-r--r--packages/opencode/src/config/config.ts1
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts4
3 files changed, 20 insertions, 0 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx
index 7bb10de89..34833f526 100644
--- a/packages/opencode/src/cli/cmd/tui/app.tsx
+++ b/packages/opencode/src/cli/cmd/tui/app.tsx
@@ -342,6 +342,21 @@ function App() {
dialog.clear()
},
},
+ {
+ title: "Suspend terminal",
+ value: "terminal.suspend",
+ keybind: "terminal_suspend",
+ category: "System",
+ onSelect: () => {
+ process.once("SIGCONT", () => {
+ renderer.resume()
+ })
+
+ renderer.suspend()
+ // pid=0 means send the signal to all processes in the process group
+ process.kill(0, "SIGTSTP")
+ },
+ },
])
createEffect(() => {
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts
index 3ffb76cba..837899be5 100644
--- a/packages/opencode/src/config/config.ts
+++ b/packages/opencode/src/config/config.ts
@@ -430,6 +430,7 @@ export namespace Config {
history_next: z.string().optional().default("down").describe("Next history item"),
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"),
})
.strict()
.meta({
diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts
index 31401b245..4c1cb33fb 100644
--- a/packages/sdk/js/src/gen/types.gen.ts
+++ b/packages/sdk/js/src/gen/types.gen.ts
@@ -846,6 +846,10 @@ export type KeybindsConfig = {
* Previous child session
*/
session_child_cycle_reverse?: string
+ /**
+ * Suspend terminal
+ */
+ terminal_suspend?: string
}
export type AgentConfig = {