Skip to content

Commit b2b812c

Browse files
committed
fix(site): use WebGL renderer for terminal
1 parent 8121e4f commit b2b812c

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

site/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"xterm-addon-fit": "0.7.0",
106106
"xterm-addon-unicode11": "0.5.0",
107107
"xterm-addon-web-links": "0.8.0",
108+
"xterm-addon-webgl": "0.15.0",
108109
"yup": "1.2.0"
109110
},
110111
"devDependencies": {

site/pnpm-lock.yaml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/AppRouter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export const AppRouter: FC = () => {
322322
{/* Terminal and CLI auth pages don't have the dashboard layout */}
323323
<Route
324324
path="/:username/:workspace/terminal"
325-
element={<TerminalPage renderer="canvas" />}
325+
element={<TerminalPage renderer="webgl" />}
326326
/>
327327
<Route path="cli-auth" element={<CliAuthenticationPage />} />
328328
</Route>

site/src/pages/TerminalPage/TerminalPage.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useNavigate, useParams, useSearchParams } from "react-router-dom"
77
import { colors } from "theme/colors"
88
import { v4 as uuidv4 } from "uuid"
99
import * as XTerm from "xterm"
10-
import { CanvasAddon } from "xterm-addon-canvas"
10+
import { WebglAddon } from "xterm-addon-webgl"
1111
import { FitAddon } from "xterm-addon-fit"
1212
import { WebLinksAddon } from "xterm-addon-web-links"
1313
import { Unicode11Addon } from "xterm-addon-unicode11"
@@ -58,7 +58,7 @@ const useTerminalWarning = ({ agent }: { agent?: WorkspaceAgent }) => {
5858
}
5959

6060
type TerminalPageProps = React.PropsWithChildren<{
61-
renderer: "canvas" | "dom"
61+
renderer: "webgl" | "dom"
6262
}>
6363

6464
const TerminalPage: FC<TerminalPageProps> = ({ renderer }) => {
@@ -187,8 +187,8 @@ const TerminalPage: FC<TerminalPageProps> = ({ renderer }) => {
187187
},
188188
})
189189
// DOM is the default renderer.
190-
if (renderer === "canvas") {
191-
terminal.loadAddon(new CanvasAddon())
190+
if (renderer === "webgl") {
191+
terminal.loadAddon(new WebglAddon())
192192
}
193193
const fitAddon = new FitAddon()
194194
setFitAddon(fitAddon)

0 commit comments

Comments
 (0)