Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
code-asher committed Sep 14, 2023
commit 78ec07ba52e827487d831895051b02202ec2c36b
4 changes: 2 additions & 2 deletions site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ const useReloading = (isDisconnected: boolean) => {
window.location.reload();
};

document.addEventListener("keydown", keyDownHandler);
document.addEventListener("keydown", keyDownHandler, true);

return () => {
document.removeEventListener("keydown", keyDownHandler);
document.removeEventListener("keydown", keyDownHandler, true);
};
}, [isDisconnected]);

Expand Down