mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
23 lines
593 B
Markdown
23 lines
593 B
Markdown
## @xterm/addon-attach
|
|
|
|
An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables attaching to a web socket. This addon requires xterm.js v4+.
|
|
|
|
### Install
|
|
|
|
```bash
|
|
npm install --save @xterm/addon-attach
|
|
```
|
|
|
|
### Usage
|
|
|
|
```ts
|
|
import { Terminal } from '@xterm/xterm';
|
|
import { AttachAddon } from '@xterm/addon-attach';
|
|
|
|
const terminal = new Terminal();
|
|
const attachAddon = new AttachAddon(webSocket);
|
|
terminal.loadAddon(attachAddon);
|
|
```
|
|
|
|
See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/addon-attach/typings/addon-attach.d.ts) for more advanced usage.
|