Skip to content

fix: reconnect terminal on non-modified key presses #9686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 18, 2023
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
Prev Previous commit
Next Next commit
Prevent issuing terminal reload when already reloading
I am not sure this actually causes any issues, but might as well.
  • Loading branch information
code-asher committed Sep 14, 2023
commit 46f26154ee01edfcc0a0bbd77bb2a1d259f6b2eb
4 changes: 2 additions & 2 deletions site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ const useReloading = (isDisconnected: boolean) => {

// Retry connection on key press when it is disconnected
useEffect(() => {
if (!isDisconnected) {
if (!isDisconnected || status === "reloading") {
return;
}

Expand All @@ -484,7 +484,7 @@ const useReloading = (isDisconnected: boolean) => {
return () => {
document.removeEventListener("keydown", keyDownHandler, true);
};
}, [isDisconnected]);
}, [status, isDisconnected]);

return {
status,
Expand Down