Using addons

Addons are JavaScript modules that attach functions to the Terminal prototype to extend its functionality.

There are a handful available in the main repository in the addons directory, but you can even write your own by leveraging on the xterm.js public API.

To use an xterm.js addon, you have to:

  1. import it into your code
  2. pass it as argument to the static method Terminal.applyAddon


import { Terminal } from 'xterm';
import * as fit from 'xterm/lib/addons/fit/fit';


let term = new Terminal();'#terminal'));;     // This method is now available for usage;  // This will do the exact same thing