Skip to content
Merged
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ services:
timeout: 5s
retries: 20

supertokens:
nixopus-supertokens:
image: registry.supertokens.io/supertokens/supertokens-postgresql:latest
container_name: supertokens

Expand Down
2 changes: 1 addition & 1 deletion view/app/terminal/utils/stopExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
21 changes: 19 additions & 2 deletions view/app/terminal/utils/useTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down