Skip to content

Commit a64f604

Browse files
authored
fix(tui): check for selected text instead of any selection in dialog escape handler (anomalyco#16779)
1 parent d7093ab commit a64f604

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/opencode/src/cli/cmd/tui/ui/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function init() {
7070
useKeyboard((evt) => {
7171
if (store.stack.length === 0) return
7272
if (evt.defaultPrevented) return
73-
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()) return
73+
if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && renderer.getSelection()?.getSelectedText()) return
7474
if (evt.name === "escape" || (evt.ctrl && evt.name === "c")) {
7575
const current = store.stack.at(-1)!
7676
current.onClose?.()

0 commit comments

Comments
 (0)