Skip to content

Commit a4830d7

Browse files
committed
feat: add ctrl-c keybindings to terminate program
1 parent 1880da5 commit a4830d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/terminal/terminal.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ export default class TerminalComponent {
140140
return false;
141141
}
142142

143+
// Check for Ctrl+C (terminate)
144+
if (event.ctrlKey && event.key === "C") {
145+
event.preventDefault();
146+
this.websocket?.send("\x03");
147+
return false;
148+
}
149+
143150
// For app-wide keybindings, dispatch them to the app's keyboard handler
144151
if (event.ctrlKey || event.altKey || event.metaKey) {
145152
// Skip modifier-only keys

0 commit comments

Comments
 (0)