|
|
@@ -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()
|