Skip to content

Commit b1e7498

Browse files
authored
chore: update xterm (#13752)
1 parent 98c09bf commit b1e7498

File tree

4 files changed

+83
-83
lines changed

4 files changed

+83
-83
lines changed

site/e2e/tests/webTerminal.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test("web terminal", async ({ context, page }) => {
5454
// try-catch is used temporarily to find the root cause: https://github.com/coder/coder/actions/runs/6176958762/job/16767089943
5555
try {
5656
await terminal.waitForSelector(
57-
'div.xterm-rows div:text-matches("hello123456")',
57+
'div.xterm-rows span:text-matches("hello123456")',
5858
{
5959
state: "visible",
6060
timeout: 10 * 1000,

site/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
"@mui/system": "5.14.0",
4646
"@mui/utils": "5.14.11",
4747
"@tanstack/react-query-devtools": "4.35.3",
48-
"@types/file-saver": "2.0.7",
48+
"@xterm/xterm": "5.5.0",
49+
"@xterm/addon-canvas": "0.7.0",
50+
"@xterm/addon-fit": "0.10.0",
51+
"@xterm/addon-unicode11": "0.8.0",
52+
"@xterm/addon-web-links": "0.11.0",
53+
"@xterm/addon-webgl": "0.18.0",
4954
"ansi-to-html": "0.7.2",
5055
"axios": "1.6.0",
5156
"canvas": "2.11.0",
@@ -88,12 +93,6 @@
8893
"undici": "6.19.2",
8994
"unique-names-generator": "4.7.1",
9095
"uuid": "9.0.0",
91-
"xterm": "5.2.0",
92-
"xterm-addon-canvas": "0.5.0",
93-
"xterm-addon-fit": "0.8.0",
94-
"xterm-addon-unicode11": "0.6.0",
95-
"xterm-addon-web-links": "0.9.0",
96-
"xterm-addon-webgl": "0.16.0",
9796
"yup": "1.3.2"
9897
},
9998
"devDependencies": {
@@ -119,6 +118,7 @@
119118
"@types/chroma-js": "2.4.0",
120119
"@types/color-convert": "2.0.0",
121120
"@types/express": "4.17.17",
121+
"@types/file-saver": "2.0.7",
122122
"@types/jest": "29.5.2",
123123
"@types/lodash": "4.14.196",
124124
"@types/node": "18.19.0",

site/pnpm-lock.yaml

Lines changed: 66 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/TerminalPage/TerminalPage.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import "xterm/css/xterm.css";
1+
import "@xterm/xterm/css/xterm.css";
22
import type { Interpolation, Theme } from "@emotion/react";
3+
import { CanvasAddon } from "@xterm/addon-canvas";
4+
import { FitAddon } from "@xterm/addon-fit";
5+
import { Unicode11Addon } from "@xterm/addon-unicode11";
6+
import { WebLinksAddon } from "@xterm/addon-web-links";
7+
import { WebglAddon } from "@xterm/addon-webgl";
8+
import { Terminal } from "@xterm/xterm";
39
import { type FC, useCallback, useEffect, useRef, useState } from "react";
410
import { Helmet } from "react-helmet-async";
511
import { useQuery } from "react-query";
612
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
713
import { v4 as uuidv4 } from "uuid";
8-
import * as XTerm from "xterm";
9-
import { CanvasAddon } from "xterm-addon-canvas";
10-
import { FitAddon } from "xterm-addon-fit";
11-
import { Unicode11Addon } from "xterm-addon-unicode11";
12-
import { WebLinksAddon } from "xterm-addon-web-links";
13-
import { WebglAddon } from "xterm-addon-webgl";
1414
import { deploymentConfig } from "api/queries/deployment";
1515
import {
1616
workspaceByOwnerAndName,
@@ -45,7 +45,7 @@ const TerminalPage: FC = () => {
4545
const terminalWrapperRef = useRef<HTMLDivElement>(null);
4646
// The terminal is maintained as a state to trigger certain effects when it
4747
// updates.
48-
const [terminal, setTerminal] = useState<XTerm.Terminal>();
48+
const [terminal, setTerminal] = useState<Terminal>();
4949
const [connectionStatus, setConnectionStatus] =
5050
useState<ConnectionStatus>("initializing");
5151
const [searchParams] = useSearchParams();
@@ -104,7 +104,7 @@ const TerminalPage: FC = () => {
104104
if (!terminalWrapperRef.current || config.isLoading) {
105105
return;
106106
}
107-
const terminal = new XTerm.Terminal({
107+
const terminal = new Terminal({
108108
allowProposedApi: true,
109109
allowTransparency: true,
110110
disableStdin: false,

0 commit comments

Comments
 (0)