Skip to content

chore(site): remove terminal xservice #10234

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 8 commits into from
Oct 20, 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
Ignore other config changes
The terminal only cares about the renderer specifically, no need to
recreate the terminal if something else changes.
  • Loading branch information
code-asher committed Oct 19, 2023
commit a38737bfbe356b0cc241313988e49a54a387327d
7 changes: 4 additions & 3 deletions site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const TerminalPage: FC = () => {
}, [lifecycleState]);

const config = useQuery(deploymentConfig());
const renderer = config.data?.config.web_terminal_renderer;

// handleWebLink handles opening of URLs in the terminal!
const handleWebLink = useCallback(
Expand Down Expand Up @@ -150,9 +151,9 @@ const TerminalPage: FC = () => {
background: colors.gray[16],
},
});
if (config.data?.config.web_terminal_renderer === "webgl") {
if (renderer === "webgl") {
terminal.loadAddon(new WebglAddon());
} else if (config.data?.config.web_terminal_renderer === "canvas") {
} else if (renderer === "canvas") {
terminal.loadAddon(new CanvasAddon());
}
const fitAddon = new FitAddon();
Expand All @@ -176,7 +177,7 @@ const TerminalPage: FC = () => {
window.removeEventListener("resize", listener);
terminal.dispose();
};
}, [config.data, config.isLoading, xtermRef, handleWebLink]);
}, [renderer, config.isLoading, xtermRef, handleWebLink]);

// Updates the reconnection token into the URL if necessary.
useEffect(() => {
Expand Down