diff options
| author | Rafi Khardalian <[email protected]> | 2026-01-04 21:14:43 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-04 23:14:43 -0600 |
| commit | 7324b2260ab66c4b61c2e578482501bef26ade38 (patch) | |
| tree | d037a20979254f09c41368dab5aafa813f6ef62e | |
| parent | 166f169dbfdfcb8758e0aa979b7c271368813d53 (diff) | |
| download | opencode-7324b2260ab66c4b61c2e578482501bef26ade38.tar.gz opencode-7324b2260ab66c4b61c2e578482501bef26ade38.zip | |
fix(tui): allow exit when viewing child session (#6898)
Co-authored-by: Aiden Cline <[email protected]>
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/session/index.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index a41f0ec0d..971f76e8d 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -65,6 +65,7 @@ import { Editor } from "../../util/editor" import stripAnsi from "strip-ansi" import { Footer } from "./footer.tsx" import { usePromptRef } from "../../context/prompt" +import { useExit } from "../../context/exit" import { Filesystem } from "@/util/filesystem" import { PermissionPrompt } from "./permission" import { DialogExportOptions } from "../../ui/dialog-export-options" @@ -191,6 +192,15 @@ export function Session() { let prompt: PromptRef const keybind = useKeybind() + // Allow exit when in child session (prompt is hidden) + const exit = useExit() + useKeyboard((evt) => { + if (!session()?.parentID) return + if (keybind.match("app_exit", evt)) { + exit() + } + }) + // Helper: Find next visible message boundary in direction const findNextVisibleMessage = (direction: "next" | "prev"): string | null => { const children = scroll.getChildren() |
