mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
Allow Ctrl + C to send interrupt in terminal (#2221)
This commit is contained in:
@@ -14,11 +14,14 @@ export function useTerminal(element: Ref<HTMLElement>) {
|
||||
terminal.loadAddon(fitAddon)
|
||||
|
||||
terminal.attachCustomKeyEventHandler((event) => {
|
||||
if (event.type === 'keydown' && (event.ctrlKey || event.metaKey)) {
|
||||
if (event.key === 'c' || event.key === 'v') {
|
||||
// Allow default browser copy/paste handling
|
||||
return false
|
||||
}
|
||||
// Allow default browser copy/paste handling
|
||||
if (
|
||||
event.type === 'keydown' &&
|
||||
(event.ctrlKey || event.metaKey) &&
|
||||
((event.key === 'c' && terminal.hasSelection()) || event.key === 'v')
|
||||
) {
|
||||
// TODO: Deselect text after copy/paste; use IPC.
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user