|
|
@@ -299,7 +299,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
|
|
|
|
|
|
useKeyboard((evt) => {
|
|
|
if (!Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) return
|
|
|
- if (!renderer.getSelection()) return
|
|
|
+ const sel = renderer.getSelection()
|
|
|
+ if (!sel) return
|
|
|
|
|
|
// Windows Terminal-like behavior:
|
|
|
// - Ctrl+C copies and dismisses selection
|
|
|
@@ -323,6 +324,11 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ const focus = renderer.currentFocusedRenderable
|
|
|
+ if (focus?.hasSelection() && sel.selectedRenderables.includes(focus)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
renderer.clearSelection()
|
|
|
})
|
|
|
|