* Add InputHandler unit tests for ISO-2022 charset mapping InputHandler unit tests always used MockCharsetService, so regressions in print()'s ASCII remapping, G0/G1 designation (ESC ( ) * +), and SO/SI level switching were never caught at unit level. Add an ISO-2022 character sets suite wired to real CharsetService and BufferService that verifies DEC line drawing on G0 (ESC ( 0), G1 after ESC ) 0 + SO, and charset/glevel restoration via ESC 7 / ESC 8 before printing. Co-authored-by: Cursor <cursoragent@cursor.com> * Add BufferService.scroll unit tests for isUserScrolling BufferService.scroll() adjusts ybase and ydisp differently depending on whether the circular buffer is full and whether isUserScrolling is set, but no unit test asserted those branches. InputHandler and other callers use MockBufferService.scroll, which throws, so real scroll viewport logic was only exercised indirectly. Add BufferService.test.ts covering full-buffer scroll with the user scrolled up (ydisp decrements), partial-buffer scroll while scrolled up (ydisp unchanged), and full-buffer scroll at the viewport bottom (ydisp tracks ybase). Co-authored-by: Cursor <cursoragent@cursor.com> * Add InputHandler unit tests for DECOM cursor positioning CUP with DEC origin mode (DECOM) offsets rows by the scroll region top and clamps within DECSTBM margins, but unit tests only toggled the mode for save/restore. Playwright covered the combination; headless unit tests did not. Add a cursor positioning test matching the Playwright DECOM case: with margins and origin on, CUP places the cursor relative to scrollTop, clamps to the margin, and uses absolute rows when origin is off. Co-authored-by: Cursor <cursoragent@cursor.com> * Add WindowsMode unit tests for wrap heuristic edges ConPTY does not set isWrapped on soft-wrapped lines; updateWindowsModeWrappedState infers wrapping from the last cell of the previous row. Browser Terminal tests exercise this only through full writes, with no direct coverage of the helper or negative cases (trailing space or null). Add WindowsMode.test.ts asserting isWrapped is set for a full non-space line, cleared for trailing whitespace, and cleared when the previous line ends empty. Co-authored-by: Cursor <cursoragent@cursor.com> * Add OscParser.reset unit test for mid-payload abort OscParser.reset() must call end(false) on active handlers when aborted during PAYLOAD, but no test invoked reset() directly. EscapeSequenceParser tests mock OSC, so production reset/cleanup was unverified at unit level. Add a reset describe block asserting handlers receive END false after a partial payload, then a subsequent OSC sequence completes normally. Co-authored-by: Cursor <cursoragent@cursor.com> * Add DcsParser.reset unit test for mid-payload abort DcsParser.reset() must call unhook(false) on hooked handlers when aborted mid-DCS, matching OscParser's end(false) cleanup. No DcsParser test called reset() directly, leaving the abort path unverified at unit level. Add a reset describe block asserting UNHOOK false after partial put, then a subsequent DCS sequence completes with UNHOOK true. Co-authored-by: Cursor <cursoragent@cursor.com> * Add InputHandler print tests for grapheme joining print() uses UnicodeService.shouldJoin to merge combining marks, but InputHandler tests never exercised that path. The U+200B infinite-loop regression test used mocks and had no assertions, so it would pass even if print() misbehaved. Add tests for e + combining acute in one parse and across two parses. Strengthen the U+200B regression test to use BufferService and assert the buffer does not grow spurious rows. Co-authored-by: Cursor <cursoragent@cursor.com> * Add CharsetService unit tests for glevel and designation CharsetService only updates the active charset when setgCharset targets the current glevel; most InputHandler tests use MockCharsetService instead. A regression in setgLevel or inactive-slot designation would not be caught without direct service tests. Add CharsetService.test.ts covering inactive designation, setgLevel activation, active-slot updates, and reset clearing state. Co-authored-by: Cursor <cursoragent@cursor.com> * Add reflowCursorLine unit tests for ConPTY resize behavior reflowCursorLine lets resize reflow wrapped lines that contain the cursor (needed when ConPTY does not). No test referenced the option or reflowLargerGetLinesToRemove's cursor skip branch. Add BufferReflow tests for skip vs reflow when the cursor is inside a wrapped block, and Buffer.resize tests showing merge on widen only when reflowCursorLine is enabled. Co-authored-by: Cursor <cursoragent@cursor.com> * Add EscapeSequenceParser reset test for async pause recovery reset() sets ParserStackType.RESET so the next parse continues in GROUND at chunkPos + 1 without resuming a paused async handler. Existing async tests only verified reset lifts FAIL after improper continuation, not mid-chunk recovery with trailing printable data. Add a test that pauses on async CSI, calls reset(), then continues parsing and asserts XY is printed once and the stack returns to NONE. Co-authored-by: Cursor <cursoragent@cursor.com> * Add Buffer.resize unit test for ConPTY row growth When rows increase on Windows ConPTY, Buffer.resize appends lines without decrementing ybase or ydisp so the viewport stays stable while ConPTY repaints. Buffer tests covered the non-Windows scroll-up path but never passed windowsPty into options. Add a ConPTY row-growth test asserting ybase, ydisp, and line count when windowsPty is configured. Co-authored-by: Cursor <cursoragent@cursor.com> * Add Buffer reflow test for ConPTY buildNumber threshold Buffer disables reflow on ConPTY when buildNumber is below 21376, but no unit test asserted that gate. Column shrink without reflow leaves wrapped content on a single line instead of splitting across rows. Add a test comparing shrink behavior at build 21375 versus 21376, plus retain unwrap-on-widen coverage for supported ConPTY builds. Co-authored-by: Cursor <cursoragent@cursor.com> * Add ApcParser.reset unit test for mid-payload abort ApcParser.reset() calls end(false) on active handlers when aborted mid-APC, matching OscParser and DcsParser, but no ApcParser test invoked reset() directly. Add a reset describe block asserting END false after partial put and a clean subsequent APC sequence. Co-authored-by: Cursor <cursoragent@cursor.com> * Add InputHandler unit test for REP with grapheme clusters repeatPrecedingCharacter uses parser.precedingJoinState and reprints the full cluster from the buffer, but only Playwright covered e + combining acute with CSI b. A regression could break REP for joined sequences without failing unit tests. Add a print-suite test asserting CSI 2 b triples e + acute in one parse. Co-authored-by: Cursor <cursoragent@cursor.com> * Add InputHandler unit tests for REP no-op cases repeatPrecedingCharacter returns early when parser.precedingJoinState is zero, including after another escape sequence clears join state. Only the positive grapheme REP case was unit tested. Add tests for bare CSI b and for REP following SGR so regressions cannot spuriously duplicate buffer content. Co-authored-by: Cursor <cursoragent@cursor.com> * Add DecorationManager unit test for wrapped search matches DecorationManager splits matches across wrapped rows with per-segment x and width, but only SearchEngine had unit coverage; decoration geometry was left to Playwright. Add DecorationManager.test.ts using a real Terminal, a wrapped-buffer match from SearchEngine, and assertions on registerDecoration options for both row segments. Co-authored-by: Cursor <cursoragent@cursor.com> * Add BufferService.scroll unit test for DECSTBM margins When scrollTop is non-zero, scroll() shifts lines inside the margin with shiftElements instead of pushing scrollback. Existing BufferService tests only covered scrollTop === 0. Add a test with margins on rows 1–3 that verifies rows outside the region stay fixed and lines inside the region scroll correctly. Co-authored-by: Cursor <cursoragent@cursor.com> * Add BufferService.scrollLines unit tests scrollLines adjusts ydisp and toggles isUserScrolling for viewport scrolling, but only scroll() had unit coverage. Regressions in the user-scroll flag or ydisp clamping would affect the whole viewport. Add tests for scrolling up, clamping at ydisp 0, and clearing isUserScrolling when reaching the buffer bottom. Co-authored-by: Cursor <cursoragent@cursor.com> * Add DecorationManager overview ruler dedup unit test Multiple highlight matches on the same buffer line should only register one overview ruler marker; later matches on that line omit ruler options. Co-authored-by: Cursor <cursoragent@cursor.com> * Assert overview ruler on each line of wrapped search match Wrapped highlight decorations span two buffer lines; each segment should register overview ruler options unlike same-line dedup. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
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, andtmux, 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 likebashand 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:
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.
import { Terminal } from '@xterm/xterm';
Then instantiate a Terminal object, open it on an element and write to it:
const term = new Terminal();
term.open(document.getElementById('terminal'));
term.write('Hello from \x1B[1;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.
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:
<link rel="stylesheet" href="node_modules/@xterm/xterm/css/xterm.css" />
Standalone example
Here is a complete standalone example in a HTML file:
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="node_modules/@xterm/xterm/css/xterm.css" />
<script src="node_modules/@xterm/xterm/lib/xterm.js"></script>
</head>
<body>
<div id="terminal"></div>
<script>
const term = new Terminal();
term.open(document.getElementById('terminal'));
term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
</script>
</body>
</html>
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:
npm install --save @xterm/addon-web-links
Then import the addon, instantiate it and call Terminal.loadAddon:
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 websocket@xterm/addon-clipboard: Access the browser's clipboard@xterm/addon-fit: Fits the terminal to the containing element@xterm/addon-image: Adds image support@xterm/addon-ligatures: Enables rendering of ligatures@xterm/addon-progress: Adds support for the progress API (OSC 9;4)@xterm/addon-search: Adds search functionality@xterm/addon-serialize: Serializes the terminal's buffer to VT sequences or HTML@xterm/addon-unicode-graphemes: Enhanced unicode support including grapheme clustering (experimental)@xterm/addon-unicode11: Updates character widths to their unicode11 values@xterm/addon-web-fonts: Easily integrate web fonts@xterm/addon-web-links: Adds web link detection and interaction@xterm/addon-webgl: Renders xterm.js using acanvaselement's webgl2 context
Browser Support
Since xterm.js is typically implemented as a developer tool, generally only modern evergreen browsers are supported officially. Specifically the latest versions of Chrome, Edge, Firefox, and Safari. Xterm.js also works seamlessly in Electron apps and may even work on earlier versions of the browsers. These are the versions we strive to keep working.
Node.js Support
We also publish @xterm/headless which is a stripped down version of xterm.js that runs headless in Node.js. An example use case for this is to keep track of a terminal's state where the process is running and using the serialize addon so it can get all state restored upon reconnection.
API
The full API for xterm.js is contained within the TypeScript declaration file, use the branch/tag picker in GitHub (w) to navigate to the correct version of the API.
Some APIs may be marked with experimental, these are added to enable experimentation with new ideas without committing to support it like a normal semver API. Note that these APIs can change radically between versions, so be sure to read release notes if you plan on using experimental APIs.
Releases
Stable releases are done on an as needed basis. All current and past releases are available on this repo's releases page, you can see what's planned for upcoming releases looking through the repository milestones.
Beta builds
Beta releases are continuously published off the master branch. Install the latest beta build with:
npm install --save @xterm/xterm@beta
The principal implementation (VS Code) typically uses the latest or near the latest beta build. Generally they are quite stable but can potentially contain bugs or breaking changes. If stability is very important we recommend using the beta build primarily to test out new features and to verify bug fixes, unless you're tracking what's landing and are comfortable taking that risk.
Contributing
Read CONTRIBUTING.md to learn how to contribute to the project.
Real-world uses
Xterm.js is used in many world-class applications to provide great terminal experiences.
- SourceLair: In-browser IDE that provides its users with fully-featured Linux terminals based on xterm.js.
- Microsoft Visual Studio Code: Modern, versatile, and powerful open source code editor that provides an integrated terminal based on xterm.js.
- ttyd: A command-line tool for sharing terminal over the web, with fully-featured terminal emulation based on xterm.js.
- Eclipse Che: Developer workspace server, cloud IDE, and Eclipse next-generation IDE.
- Codenvy: Cloud workspaces for development teams.
- CoderPad: Online interviewing platform for programmers. Run code in many programming languages, with results displayed by xterm.js.
- WebSSH2: A web based SSH2 client using xterm.js, socket.io, and ssh2.
- Spyder Terminal: A full fledged system terminal embedded on Spyder IDE.
- Cloud Commander: Orthodox web file manager with console and editor.
- Next Tech: Online platform for interactive coding and web development courses. Live container-backed terminal uses xterm.js.
- RStudio: RStudio is an integrated development environment (IDE) for R.
- Terminal for Atom: A simple terminal for the Atom text editor.
- Eclipse Orion: A modern, open source software development environment that runs in the cloud. Code, deploy, and run in the cloud.
- Gravitational Teleport: Gravitational Teleport is a modern SSH server for remotely accessing clusters of Linux servers via SSH or HTTPS.
- Hexlet: Practical programming courses (JavaScript, PHP, Unix, databases, functional programming). A steady path from the first line of code to the first job.
- Selenoid UI: Simple UI for the scalable golang implementation of Selenium Hub named Selenoid. We use XTerm for streaming logs over websockets from docker containers.
- Portainer: Simple management UI for Docker.
- SSHy: HTML5 Based SSHv2 Web Client with E2E encryption utilising xterm.js, SJCL & websockets.
- JupyterLab: An extensible computational environment for Jupyter, supporting interactive data science and scientific computing across all programming languages.
- Theia: Theia is a cloud & desktop IDE framework implemented in TypeScript.
- Opshell Ops Helper tool to make life easier working with AWS instances across multiple organizations.
- Proxmox VE: Proxmox VE is a complete open-source platform for enterprise virtualization. It uses xterm.js for container terminals and the host shell.
- Script Runner: Run scripts (or a shell) in Atom.
- Whack Whack Terminal: Terminal emulator for Visual Studio 2017.
- VTerm: Extensible terminal emulator based on Electron and React.
- electerm: electerm is a terminal/ssh/sftp client(mac, win, linux) based on electron/node-pty/xterm.
- Kubebox: Terminal console for Kubernetes clusters.
- Azure Cloud Shell: Azure Cloud Shell is a Microsoft-managed admin machine built on Azure, for Azure.
- atom-xterm: Atom plugin for providing terminals inside your Atom workspace.
- rtty: Access your terminals from anywhere via the web.
- Pisth: An SFTP and SSH client for iOS.
- abstruse: Abstruse CI is a continuous integration platform based on Node.JS and Docker.
- Azure Data Studio: A data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
- FreeMAN: A free, cross-platform file manager for power users.
- Fluent Terminal: A terminal emulator based on UWP and web technologies.
- Hyper: A terminal built on web technologies.
- Diag: A better way to troubleshoot problems faster. Capture, share and reapply troubleshooting knowledge so you can focus on solving problems that matter.
- GoTTY: A simple command line tool that shares your terminal as a web application based on xterm.js.
- genact: A nonsense activity generator.
- cPanel & WHM: The hosting platform of choice.
- Nutanix: Nutanix Enterprise Cloud uses xterm in the webssh functionality within Nutanix Calm, and is also looking to move our old noserial (termjs) functionality to xterm.js.
- SSH Web Client: SSH Web Client with PHP.
- Juno: A flexible Julia IDE, based on Atom.
- webssh: Web based ssh client.
- info-beamer hosted: Uses xterm.js to manage digital signage devices from the web dashboard.
- Jumpserver: Jumpserver Luna project, Jumpserver is a bastion server project, Luna use xterm.js for web terminal emulation.
- LxdMosaic: Uses xterm.js to give terminal access to containers through LXD
- CodeInterview.io: A coding interview platform in 25+ languages and many web frameworks. Uses xterm.js to provide shell access.
- Bastillion: Bastillion is an open-source web-based SSH console that centrally manages administrative access to systems.
- PHP App Server: Create lightweight, installable almost-native applications for desktop OSes. ExecTerminal (nicely wraps the xterm.js Terminal), TerminalManager, and RunProcessSDK are self-contained, reusable ES5+ compliant Javascript components.
- NgTerminal: NgTerminal is a web terminal that leverages xterm.js on Angular 7+. You can easily add it into your application by adding
<ng-terminal></ng-terminal>into your component. - tty-share: Extremely simple terminal sharing over the Internet.
- Ten Hands: One place to run your command-line tasks.
- WebAssembly.sh: A WebAssembly WASI browser terminal
- Gus: A shared coding pad where you can run Python with xterm.js
- Linode: Linode uses xterm.js to provide users a web console for their Linode instances.
- FluffOS: Active maintained LPMUD driver with websocket support.
- x-terminal: Atom plugin for providing terminals inside your Atom workspace.
- CoCalc: Lots of free software pre-installed, to chat, collaborate, develop, program, publish, research, share, teach, in C++, HTML, Julia, Jupyter, LaTeX, Markdown, Python, R, SageMath, Scala, ...
- Dank Domain: Open source multiuser medieval game supporting old & new terminal emulation.
- DockerStacks: Local LAMP/LEMP development studio
- Codecademy: Uses xterm.js in its courses on Bash.
- Laravel Ssh Web Client: Laravel server inventory with ssh web client to connect at server using xterm.js
- Replit: Collaborative browser based IDE with support for 50+ different languages.
- TeleType: cli tool that allows you to share your terminal online conveniently. Show off mad cli-fu, help a colleague, teach, or troubleshoot.
- Intervue: Pair programming for interviews. Multiple programming languages are supported, with results displayed by xterm.js.
- TRASA: Zero trust access to Web, SSH, RDP, and Database services.
- Commas: Commas is a hackable terminal and command runner.
- Devtron: Software Delivery Workflow For Kubernetes.
- NxShell: An easy to use new terminal for SSH.
- gifcast: Converts an asciinema cast to an animated GIF.
- WizardWebssh: A terminal with Pyqt5 Widget for embedding, which can be used as an ssh client to connect to your ssh servers. It is written in Python, based on tornado, paramiko, and xterm.js.
- Wizard Assistant: Wizard Assistant comes with advanced automation tools, preloaded common and special time-saving commands, and a built-in SSH terminal. Now you can remotely administer, troubleshoot, and analyze any system with ease.
- ucli: Command Line for everyone 👨👩👧👦 at www.ucli.tech.
- Tess: Simple Terminal Fully Customizable for Everyone. Discover more at tessapp.dev
- HashiCorp Nomad: A container orchestrator with the ability to connect to remote tasks via a web interface using websockets and xterm.js.
- TermPair: View and control terminals from your browser with end-to-end encryption
- gdbgui: Browser-based frontend to gdb (gnu debugger)
- goormIDE: Run almost every programming languages with real-time collaboration, live pair programming, and built-in messenger.
- FleetDeck: Remote desktop & virtual terminal
- OpenSumi: A framework helps you quickly build Cloud or Desktop IDE products.
- KubeSail: The Self-Hosting Company - uses xterm to allow users to exec into kubernetes pods and build github apps
- WiTTY: Web-based interactive terminal emulator that allows users to easily record, share, and replay console sessions.
- libv86 Terminal Forwarding: Peer-to-peer SSH for the web, using WebRTC via Bugout for data transfer and v86 for web-based virtualization.
- hack.courses: Interactive Linux and command-line classes using xterm.js to expose a real terminal available for everyone.
- Render: Platform-as-a-service for your apps, websites, and databases using xterm.js to provide a command prompt for user containers and for streaming build and runtime logs.
- CloudTTY: A Friendly Kubernetes CloudShell (Web Terminal).
- Go SSH Web Client: A simple SSH web client using Go, WebSocket and Xterm.js.
- web3os: A decentralized operating system for the next web
- Cratecode: Learn to program for free through interactive online lessons. Cratecode uses xterm.js to give users access to their own Linux environment.
- Super Terminal: It is a http based terminal for developers who dont like repetition and save time.
- graSSHopper: A simple SSH client with file explorer, history and many more features.
- DomTerm: Tiles and tabs. Detachable sessions (like tmux). Remote connections using a nice ssh wrapper with predictive echo. Qt, Electron, Tauri/Wry, or desktop browser front-ends. Choose between xterm.js engine (faster) or native DomTerm (more functionality and graphics) - or both.
- Cloudtutor.io: innovative online learning platform that offers users access to an interactive lab.
- Helix Editor Playground: Online playground for the terminal based helix editor.
- Coder: Self-Hosted Remote Development Environments
- Wave Terminal: An open-source, ai-native, terminal built for seamless workflows.
- eva: Eva is a web application for SSH remote login, developed in Go.
- OpenSFTP: Super beautiful SSH and SFTP integrated workspace client.
- balena: Balena is a full-stack solution for developing, deploying, updating, and troubleshooting IoT Edge devices. We use xterm.js to manage & debug devices on balenaCloud.
- Filet Cloud: The lean and powerful personal cloud ⛅.
- pyTermTk: Python Terminal Toolkit - a Spiced Up Cross Compatible TUI Library 🌶️, use xterm.js for the HTML5 exporter.
- ecmaOS: A kernel and suite of applications tying modern web technologies into a browser-based operating system.
- LabEx: Interactive learning platform with hands-on labs and xterm.js-based online terminals, focused on learn-by-doing approach.
- EmuDevz: A free coding game where players learn how to build an emulator from scratch.
- SSH Connection Manager: Modern web-based SSH terminal and SFTP manager with AES-256 encryption, PWA support, and session management.
- WooTTY: Flawless browser terminal for real operators.
- Orca: Agentic development environment for 100x builders.
- 4bit: Terminal Color Scheme Designer.
- And much more...
Do you use xterm.js in your application as well? Please open a Pull Request to include it here. We would love to have it on our list. Please add any new contributions to the end of the list.
License Agreement
If you contribute code to this project, you implicitly allow your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work.
Copyright (c) 2017-2026, The xterm.js authors (MIT License)
Copyright (c) 2014-2017, SourceLair, Private Company (www.sourcelair.com) (MIT License)
Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
