Skip to content

Commit 775277f

Browse files
authored
docs: migrate to xterm namespaced imports (#63)
1 parent 673b6a5 commit 775277f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/tutorial/6-connect-a-terminal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Your Express app is up and running and the preview window updates automatically
1616
The terminal frontend component that we will use is [`Xterm.js`](https://xtermjs.org). It's the same terminal that is used by Visual Studio Code and many other web-based IDEs. To install it, run the following command in your development terminal:
1717

1818
```bash
19-
npm install xterm
19+
npm install @xterm/xterm
2020
```
2121

2222
## 2. Build terminal scaffolding
@@ -62,7 +62,7 @@ First of all, import `Xterm.js`. To do so, add an import statement at the top of
6262

6363
:::code-group
6464
```js [main.js]
65-
import { Terminal } from 'xterm'
65+
import { Terminal } from '@xterm/xterm'
6666
```
6767
:::
6868

@@ -105,7 +105,7 @@ The terminal looks a bit plain now. Fortunately, `Xterm.js` ships its own CSS st
105105

106106
:::code-group
107107
```js [main.js]
108-
import 'xterm/css/xterm.css';
108+
import '@xterm/xterm/css/xterm.css';
109109
```
110110
:::
111111

docs/tutorial/7-add-interactivity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,27 +144,27 @@ With this change, you hooked up your terminal to the shell running in the WebCon
144144
![The commands typed in the terminal](./images/20-typing.png)
145145

146146

147-
## 4. Add `xterm-addon-fit`
147+
## 4. Add `@xterm/addon-fit`
148148

149149
You might've noticed that resizing the window doesn't redraw the terminal output. If you make the window very narrow, lines that are too long don't wrap to the next line, which is not a good UX practice. For example, look at the highlightened line:
150150

151151
![The browser window is very narrow now and the terminal features a line that either disappears or when highlightened sticks out](./images/21-line-sticking-out.png)
152152

153153
To fix this, you'll need to make the WebContainer process aware of the size of the terminal.
154154

155-
First of all, let's make sure that the terminal itself gets adjusted properly when resizing the window. To do that, you can use the [`xterm-addon-fit`](http://xtermjs.org/docs/api/addons/fit/) plugin for `Xterm.js` which adjusts the terminal columns and rows depending on the element it's rendered in.
155+
First of all, let's make sure that the terminal itself gets adjusted properly when resizing the window. To do that, you can use the [`@xterm/addon-fit`](http://xtermjs.org/docs/api/addons/fit/) plugin for `Xterm.js` which adjusts the terminal columns and rows depending on the element it's rendered in.
156156

157157
First, install the plugin:
158158

159159
```bash
160-
npm install xterm-addon-fit
160+
npm install @xterm/addon-fit
161161
```
162162

163163
And import it at the top of your `main.js` file.
164164

165165
:::code-group
166166
```js [main.js]
167-
import { FitAddon } from 'xterm-addon-fit';
167+
import { FitAddon } from '@xterm/addon-fit';
168168
```
169169
:::
170170

0 commit comments

Comments
 (0)