diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 9ea5009463..0507c6f024 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -202,8 +202,11 @@ export function tui(input: { await render(() => { return ( } + // kilocode_change start + fallback={(error, reset) => ( + + )} + // kilocode_change end > @@ -964,10 +967,12 @@ function App(props: { onSnapshot?: () => Promise }) { {plugin()} + {/* kilocode_change start */} ) -} // kilocode_change +} +// kilocode_change end // kilocode_change start — guard against missing renderer context in ErrorBoundary fallback function tryUseRenderer() { @@ -991,6 +996,7 @@ function tryUseTerminalDimensions() { function ErrorComponent(props: { error: Error reset: () => void + onBeforeExit?: () => Promise onExit: () => Promise mode?: "dark" | "light" }) { @@ -1000,6 +1006,7 @@ function ErrorComponent(props: { const height = () => term?.().height ?? process.stdout.rows ?? 24 const handleExit = async () => { + await props.onBeforeExit?.() renderer?.setTerminalTitle("") renderer?.destroy() win32FlushInputBuffer()