Skip to content

Commit

Permalink
Implement Ctrl+C
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 21, 2024
1 parent 8a7fccc commit a7a0914
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/hooks/useTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ export const useTerminal = (commands: Command[] = []) => {
}
});
terminal.current.attachCustomKeyEventHandler((arg) => {
// ctrl + c to interrupt
if (
(arg.ctrlKey || arg.metaKey) &&
arg.code === "KeyC" &&
arg.type === "keydown"
) {
sendTerminalCommand("\x03");
}
if (
(arg.ctrlKey || arg.metaKey) &&
arg.code === "KeyV" &&
Expand Down

0 comments on commit a7a0914

Please sign in to comment.