Skip to content

Commit 7324b22

Browse files
rmk40rekram1-node
andauthored
fix(tui): allow exit when viewing child session (#6898)
Co-authored-by: Aiden Cline <[email protected]>
1 parent 166f169 commit 7324b22

File tree

1 file changed

+10
-0
lines changed
  • packages/opencode/src/cli/cmd/tui/routes/session

1 file changed

+10
-0
lines changed

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import { Editor } from "../../util/editor"
6565
import stripAnsi from "strip-ansi"
6666
import { Footer } from "./footer.tsx"
6767
import { usePromptRef } from "../../context/prompt"
68+
import { useExit } from "../../context/exit"
6869
import { Filesystem } from "@/util/filesystem"
6970
import { PermissionPrompt } from "./permission"
7071
import { DialogExportOptions } from "../../ui/dialog-export-options"
@@ -191,6 +192,15 @@ export function Session() {
191192
let prompt: PromptRef
192193
const keybind = useKeybind()
193194

195+
// Allow exit when in child session (prompt is hidden)
196+
const exit = useExit()
197+
useKeyboard((evt) => {
198+
if (!session()?.parentID) return
199+
if (keybind.match("app_exit", evt)) {
200+
exit()
201+
}
202+
})
203+
194204
// Helper: Find next visible message boundary in direction
195205
const findNextVisibleMessage = (direction: "next" | "prev"): string | null => {
196206
const children = scroll.getChildren()

0 commit comments

Comments
 (0)