mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-05 16:02:19 +00:00
tui: added ctrl-z terminal suspension support (#3983)
This commit is contained in:
parent
bdcf864678
commit
6afdb5c0e5
3 changed files with 20 additions and 0 deletions
|
|
@ -342,6 +342,21 @@ function App() {
|
||||||
dialog.clear()
|
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(() => {
|
createEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,7 @@ export namespace Config {
|
||||||
history_next: z.string().optional().default("down").describe("Next history item"),
|
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: z.string().optional().default("<leader>right").describe("Next child session"),
|
||||||
session_child_cycle_reverse: z.string().optional().default("<leader>left").describe("Previous 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()
|
.strict()
|
||||||
.meta({
|
.meta({
|
||||||
|
|
|
||||||
|
|
@ -846,6 +846,10 @@ export type KeybindsConfig = {
|
||||||
* Previous child session
|
* Previous child session
|
||||||
*/
|
*/
|
||||||
session_child_cycle_reverse?: string
|
session_child_cycle_reverse?: string
|
||||||
|
/**
|
||||||
|
* Suspend terminal
|
||||||
|
*/
|
||||||
|
terminal_suspend?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AgentConfig = {
|
export type AgentConfig = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue