fix(terminal): support Ctrl/Cmd+Shift+C copy shortcut

This commit is contained in:
Matheus Nogueira
2026-03-26 20:17:28 -03:00
parent 406f95b072
commit fbdffdd014
@@ -72,6 +72,25 @@ export function useTerminalKeyboardShortcuts({
return
}
// Cmd/Ctrl+Shift+C copies terminal selection via Electron clipboard.
// This ensures Linux terminal copy works consistently.
if (e.shiftKey && e.key.toLowerCase() === 'c') {
const pane = manager.getActivePane() ?? manager.getPanes()[0]
if (!pane) {
return
}
const selection = pane.terminal.getSelection()
if (!selection) {
return
}
e.preventDefault()
e.stopPropagation()
void window.api.ui.writeClipboardText(selection).catch(() => {
/* ignore clipboard write failures */
})
return
}
// Keep Cmd+F bound to the terminal search until the app has a real
// top-level find-in-page flow to fall back to.
if (!e.shiftKey && e.key.toLowerCase() === 'f') {