Skip to content

Commit 78ec07b

Browse files
committed
Listen to web terminal keydown on capture
Instead of bubbling. I think maybe what happens here is that xterm is capturing key presses and preventing the event from bubbling? So setting the listener on the capture phase instead works around this. Probably would also work to dipsose the terminal.
1 parent 225cf8a commit 78ec07b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/src/pages/TerminalPage/TerminalPage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,10 @@ const useReloading = (isDisconnected: boolean) => {
479479
window.location.reload();
480480
};
481481

482-
document.addEventListener("keydown", keyDownHandler);
482+
document.addEventListener("keydown", keyDownHandler, true);
483483

484484
return () => {
485-
document.removeEventListener("keydown", keyDownHandler);
485+
document.removeEventListener("keydown", keyDownHandler, true);
486486
};
487487
}, [isDisconnected]);
488488

0 commit comments

Comments
 (0)