feat(tui): go to parent keybind for subagents (#5762)

This commit is contained in:
Rohan Godha
2025-12-22 15:50:45 -05:00
committed by GitHub
parent e015bea462
commit 25f1643e8e
5 changed files with 30 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ export function Header() {
<text fg={theme.text}>
<b>Subagent session</b>
</text>
<text fg={theme.text}>
Parent <span style={{ fg: theme.textMuted }}>{keybind.print("session_parent")}</span>
</text>
<text fg={theme.text}>
Prev <span style={{ fg: theme.textMuted }}>{keybind.print("session_child_cycle_reverse")}</span>
</text>

View File

@@ -870,6 +870,23 @@ export function Session() {
dialog.clear()
},
},
{
title: "Go to parent session",
value: "session.parent",
keybind: "session_parent",
category: "Session",
disabled: true,
onSelect: (dialog) => {
const parentID = session()?.parentID
if (parentID) {
navigate({
type: "session",
sessionID: parentID,
})
}
dialog.clear()
},
},
])
const revertInfo = createMemo(() => session()?.revert)

View File

@@ -562,6 +562,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"),
session_parent: z.string().optional().default("<leader>up").describe("Go to parent session"),
terminal_suspend: z.string().optional().default("ctrl+z").describe("Suspend terminal"),
terminal_title_toggle: z.string().optional().default("none").describe("Toggle terminal title"),
})

View File

@@ -1122,6 +1122,10 @@ export type KeybindsConfig = {
* Previous child session
*/
session_child_cycle_reverse?: string
/**
* Go to parent session
*/
session_parent?: string
/**
* Suspend terminal
*/

View File

@@ -7598,6 +7598,11 @@
"default": "<leader>left",
"type": "string"
},
"session_parent": {
"description": "Go to parent session",
"default": "<leader>up",
"type": "string"
},
"terminal_suspend": {
"description": "Suspend terminal",
"default": "ctrl+z",