fix(terminal): restore terminal text copy behavior (#452)

* fix(terminal): restore terminal text copy behavior

* fix(desktop): route Cmd+C through terminal-aware copy handler on macOS

- Use a custom macOS Copy menu action to dispatch app copy events first, so terminal selections copy without native “no target” beep, while preserving DOM copy fallback for non-terminal contexts.

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
shekohex
2026-02-20 13:23:01 +02:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 7bcf848035
commit 881e8bdf4f
4 changed files with 73 additions and 39 deletions
+10
View File
@@ -35,6 +35,7 @@ type MenuAction =
| 'open-diff-tab'
| 'open-files-tab'
| 'open-terminal-tab'
| 'copy'
| 'theme-light'
| 'theme-dark'
| 'theme-system'
@@ -152,6 +153,15 @@ export const useMenuActions = (
break;
}
case 'copy': {
const copyEvent = new Event('openchamber:copy', { cancelable: true });
const wasHandled = !window.dispatchEvent(copyEvent);
if (!wasHandled) {
document.execCommand('copy');
}
break;
}
case 'theme-light':
setThemeMode('light');
break;