File tree Expand file tree Collapse file tree
packages/opencode/src/cli/cmd/tui/routes/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
1414import { Keybind } from "@/util/keybind"
1515import { Locale } from "@/util/locale"
1616import { Global } from "@/global"
17+ import { useDialog } from "../../ui/dialog"
1718
1819type PermissionStage = "permission" | "always" | "reject"
1920
@@ -304,8 +305,11 @@ function RejectPrompt(props: { onConfirm: (message: string) => void; onCancel: (
304305 const textareaKeybindings = useTextareaKeybindings ( )
305306 const dimensions = useTerminalDimensions ( )
306307 const narrow = createMemo ( ( ) => dimensions ( ) . width < 80 )
308+ const dialog = useDialog ( )
307309
308310 useKeyboard ( ( evt ) => {
311+ if ( dialog . stack . length > 0 ) return
312+
309313 if ( evt . name === "escape" || keybind . match ( "app_exit" , evt ) ) {
310314 evt . preventDefault ( )
311315 props . onCancel ( )
@@ -384,8 +388,11 @@ function Prompt<const T extends Record<string, string>>(props: {
384388 } )
385389 const diffKey = Keybind . parse ( "ctrl+f" ) [ 0 ]
386390 const narrow = createMemo ( ( ) => dimensions ( ) . width < 80 )
391+ const dialog = useDialog ( )
387392
388393 useKeyboard ( ( evt ) => {
394+ if ( dialog . stack . length > 0 ) return
395+
389396 if ( evt . name === "left" || evt . name == "h" ) {
390397 evt . preventDefault ( )
391398 const idx = keys . indexOf ( store . selected )
You can’t perform that action at this time.
0 commit comments