Skip to content
Open
9 changes: 9 additions & 0 deletions packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TextAttributes } from "@opentui/core"
import { useKeyboard } from "@opentui/solid"
import { fileURLToPath } from "bun"
import { useTheme } from "../context/theme"
import { useDialog } from "@tui/ui/dialog"
Expand All @@ -12,6 +13,14 @@ export function DialogStatus() {
const { theme } = useTheme()
const dialog = useDialog()

// Handle escape key to close dialog
useKeyboard((evt) => {
if (evt.name === "escape") {
dialog.clear()
evt.preventDefault()
}
})

const enabledFormatters = createMemo(() => sync.data.formatter.filter((f) => f.enabled))

const plugins = createMemo(() => {
Expand Down