Xterm.js is a TypeScript terminal component that embeds a full terminal experience in web pages and Electron apps.
Overview
Xterm.js lets applications render an interactive terminal in the browser by attaching a Terminal instance to a DOM element and wiring I/O to a pseudoterminal backend such as node-pty. It is a front-end library, not a standalone desktop terminal program users install on its own.
The core aims to run common terminal programs including bash, vim, and tmux, with optional GPU acceleration via a WebGL renderer addon. Unicode coverage includes CJK text, emoji, and input method editors. Accessibility options include screen reader mode and minimum contrast support, and the core package ships without runtime dependencies.
Official addons extend the base API for fit-to-container sizing, search, clipboard access, web links, image rendering, ligatures, serialization, and websocket attach helpers. Distribution is through npm as @xterm/xterm with matching CSS, and a headless Node variant exists for tracking buffer state server-side.
Projects such as VS Code, Hyper, Tabby, JupyterLab, and many SSH or cloud IDEs integrate Xterm.js for in-browser consoles. Supported browsers are current Chrome, Edge, Firefox, and Safari, with Electron called out as a common host environment.
Key features
- DOM-embeddable terminal emulator
- bash, vim, and tmux compatibility
- Optional WebGL renderer addon
- CJK, emoji, and IME support
- Zero core dependencies
- Screen reader and contrast modes
- Search, fit, links, and attach addons
- Headless Node variant available
Use cases
- Integrated terminals in web IDEs
- Browser-based SSH clients
- Cloud shell and training sandboxes
- Electron app terminal panes
- Remote container log streaming UIs