1 | ## xterm-addon-fit
|
2 |
|
3 | An 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
|
8 | npm install --save xterm-addon-fit
|
9 | ```
|
10 |
|
11 | ### Usage
|
12 |
|
13 | ```ts
|
14 | import { Terminal } from 'xterm';
|
15 | import { FitAddon } from 'xterm-addon-fit';
|
16 |
|
17 | const terminal = new Terminal();
|
18 | const fitAddon = new FitAddon();
|
19 | terminal.loadAddon(fitAddon);
|
20 | terminal.open(containerElement);
|
21 | fitAddon.fit();
|
22 | ```
|
23 |
|
24 | See 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.
|