diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index dcea5aefc..88cc9237d 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -105,7 +105,7 @@ services: timeout: 5s retries: 20 - supertokens: + nixopus-supertokens: image: registry.supertokens.io/supertokens/supertokens-postgresql:latest container_name: supertokens diff --git a/view/app/terminal/utils/stopExecution.ts b/view/app/terminal/utils/stopExecution.ts index b279903c1..8a3c6d5af 100644 --- a/view/app/terminal/utils/stopExecution.ts +++ b/view/app/terminal/utils/stopExecution.ts @@ -4,7 +4,7 @@ export const StopExecution = () => { const [isStopped, setIsStopped] = useState(false); useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === 'c' && (e.metaKey || e.ctrlKey)) { + if (e.key === 'c' && (e.metaKey || e.ctrlKey) && e.shiftKey) { e.preventDefault(); console.log('Stopped execution'); setIsStopped(true); diff --git a/view/app/terminal/utils/useTerminal.ts b/view/app/terminal/utils/useTerminal.ts index c7ba165af..e7ab8b4d2 100644 --- a/view/app/terminal/utils/useTerminal.ts +++ b/view/app/terminal/utils/useTerminal.ts @@ -157,12 +157,29 @@ export const useTerminal = ( if (allowInput) { term.attachCustomKeyEventHandler((event: KeyboardEvent) => { - if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'j') { + const key = event.key.toLowerCase(); + if (key === 'j' && (event.ctrlKey || event.metaKey)) { + return false; + } + else if (key === 'c' && (event.ctrlKey || event.metaKey) && !event.shiftKey) { + if (event.type === 'keydown' ) { + try { + const selection = term.getSelection(); + if (selection) { + navigator.clipboard.writeText(selection) + .then(() => { + term.clearSelection(); // Clear selection after successful copy + }) + return false; + } + } catch (error) { + console.error('Error in Ctrl+C handler:', error); + } + } return false; } return true; }); - term.onData((data) => { sendJsonMessage({ action: 'terminal',