+1
Daily
+38
Weekly
+82
Monthly
21,355
stars
2,057
forks
182
watchers
3,137
prs
2,930
issues
89
releases
README
Xterm.js is a frontend component that enables applications to bring fully-featured terminals to their users in the browser. It's used by popular projects such as VS Code (and its forks), Tabby and Hyper.
Features
- Terminal apps just work: Xterm.js works with most terminal apps such as bash, vim, and tmux, including support for curses-based apps and mouse events.
- Performant: Xterm.js is really fast and includes an optional GPU-accelerated renderer.
- Rich Unicode support: Supports CJK, emojis, and IMEs.
- Self-contained: The core library has zero dependencies.
- Accessible: Screen reader mode and minimum contrast ratio support can be turned on.
- And much more: Links, theming, custom glyphs, addons, well documented API, etc.
What xterm.js is not
- Xterm.js is not a terminal application that you can download and use on your computer.
- Xterm.js is not bash. Xterm.js can be connected to processes like bash and let you interact with them (provide input, receive output) through a library like node-pty.
Getting Started
First, you need to install the module. We ship exclusively through npm, so you need that installed and then add @xterm/xterm as a dependency by running:
bash
npm install --save @xterm/xterm
The recommended way to load xterm.js with the ES module syntax, either using TypeScript or a modern JS tooling. Note that both CommonJS and ES module files are shipped with the npm package.
javascript
import { Terminal } from '@xterm/xterm';
Then instantiate a Terminal object, open it on an element and write to it:
javascript
const term = new Terminal();
term.open(document.getElementById('terminal'));
term.write('Hello from \x1B1;3;31mxterm.js\x1B[0m $ ')
Most use cases will hook up input and output to a pseudoterminal API such as [node-pty which will drive the terminal.
javascript
pty.onData(data = term.write(data));
term.onData(data = pty.write(data));
Then make sure to also include the css/xterm.css file, for example in HTML:
html
Standalone example
Here is a complete standalone example in a HTML file:
html
const term = new Terminal();
term.open(document.getElementById('terminal'));
term.write('Hello from \x1B1;3;31mxterm.js\x1B[0m $ ')
Addons
Addons are separate modules that extend the Terminal by building on the [xterm.js API. To use an addon, you first need to install it in your project:
bash
npm install --save @xterm/addon-web-links
Then import the addon, instantiate it and call Terminal.loadAddon:
ts
import { Terminal } from '@xterm/xterm';
import { WebLinksAddon } from '@xterm/addon-web-links';
const terminal = new Terminal();
// Load WebLinksAddon on terminal, this is all that's needed to get web links
// working in the terminal.
terminal.loadAddon(new WebLinksAddon());
The xterm.js team maintains the following addons, but anyone can build them:
- @xterm/addon-attach: Attaches to a server running a process via a weTop issues
#2151Scandinavian keyboard layout can't handle input tilde (~)52 comments · 2019-05-31#701Support RTL languages49 comments · 2017-06-13#2570Support XTPUSHSGR / XTPOPSGR25 comments · 2019-11-16#4800Proposal: more compact and flexible BufferLine data structure24 comments · 2023-09-13#4445Latest version requires unsafe-inline due to inline styles24 comments · 2023-03-23#5686Explore adopting libghostty20 comments · 2026-02-09#1898Handling transparent BG color when used as FG20 comments · 2019-01-16#5412xterm WebLinkAddon does not detect links with new line (broken from xterm fit)14 comments · 2025-10-06
Discussions
#6268Dead keys produce duplicated characters on iOS/iPadOS Safari (or VisualCode, Termius, …) with a hardware keyboard1 comments · 2026-10-28#6155JupyterHub Terminal gets clobbered with ascii color codes1 comments · 2026-09-06#6103am I wasting my time here?1 comments · 2026-08-13#6087REMOSSH: an xterm.js terminal over SSH with reconnectable tmux sessions0 comments · 2026-08-03#5869Mouse selection on a scaled canvas element0 comments · 2026-05-04#5843Letters always look "fat" in xterm.js? Its like there is always too much anti-aliasing or blurring.. is there a way to tweak these settings?1 comments · 2026-04-26#5833How to prevent the prompt to push down when resize height?2 comments · 2026-04-23#5703unicode (proof of concept)2 comments · 2026-02-14
Latest release
6.0.0 6.0.0 2025-12-22Features - 5453 Add synchronized output support (DEC mode 2026) - 5436 add range to IHTMLSerializeOptions - 5334 Support shadow dom in webgl renderer - 5285 Support detailed ligatures and variants - 5251 progress-addon - 5234 Add reflowCursorLine option - 5224 putty-style ED2 sequence handling as terminal option - 5107 Add top/bottom border overview ruler options - :warning: This is a breaking change, ITerminalOptions.overviewRulerWidth is now a property of ITerminalOptions.overviewRuler - 5096 Integrate base/ platform from VS Code and adopt scroll bar - :warning: This is a po