UNPKG

640 BMarkdownView Raw
1## xterm-addon-fit
2
3An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables fitting the terminal's dimensions to a containing element. This addon requires xterm.js v4+.
4
5### Install
6
7```bash
8npm install --save xterm-addon-fit
9```
10
11### Usage
12
13```ts
14import { Terminal } from 'xterm';
15import { FitAddon } from 'xterm-addon-fit';
16
17const terminal = new Terminal();
18const fitAddon = new FitAddon();
19terminal.loadAddon(fitAddon);
20terminal.open(containerElement);
21fitAddon.fit();
22```
23
24See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/typings/xterm-addon-fit.d.ts) for more advanced usage.