Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/opencode/src/cli/cmd/tui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,17 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
renderer.clearSelection()
})

// Fallback exit handler for routes without their own exit handling (e.g. plugin routes).
// Home and session routes handle app_exit in their own components, so skip those here.
useKeyboard((evt) => {
if (evt.defaultPrevented) return
if (route.data.type === "home" || route.data.type === "session") return
if (!keybind.match("app_exit", evt)) return
exit()
evt.preventDefault()
evt.stopPropagation()
})

// Wire up console copy-to-clipboard via opentui's onCopySelection callback
renderer.console.onCopySelection = async (text: string) => {
if (!text || text.length === 0) return
Expand Down
Loading