What it is

ExTC is a terminal emulator written in Elixir, plus a Phoenix LiveView component that renders it. The emulator runs on the server; the browser receives server-rendered HTML, and LiveView's diff engine does the drawing. There is no npm package, no bundler step, no canvas and no WebGL.

Why it exists

Browser terminals today run the emulator in the browser, usually by way of xterm.js. That is a reasonable design, and it comes with costs that follow from where the emulator lives. Moving the emulator to the server changes several of them from features into consequences:

The counterweight is latency: every keystroke makes a round trip. The specification covers a predictive-echo approach of the kind mosh uses, but it is not built yet.

Example

Start a session and render it:

{:ok, _} = ExTC.start_session("console", backend: {ExTC.Backend.Pty, cmd: "/bin/bash"})
<ExTC.LiveTerminal.terminal id="console" session="console" role={:read_write} />

Then register ExTC's colocated hooks in app.js beside the application's own. That is the whole integration. mix extc.demo opens a terminal in a browser with no asset build.

How it works

ExTC.Vt is a pure functional core: a struct and feed(vt, bytes) -> {vt, effects}, with no processes, I/O or dependencies. That choice is why a snapshot is a single term_to_binary, why replay is a fold, and why the parser can be model-checked and differentially tested without scaffolding.

Around it sits a thin OTP shell (an emulator process, a backend process, a scrollback table) and a LiveView component that streams rows keyed by line id. A scroll is one insert and a prune rather than a repaint, and the cursor is an overlay, so moving it changes no row.

Two claims in the specification, one about the parser and one about credit-based flow control, quantify over every reachable state, so they are model-checked with ExTLA rather than only tested. The flow-control model refuted one candidate design before any of it was written.

What works today

Not yet: OSC 8 links, recording and replay, images, automatic shell-integration injection, and the conformance suites.

Status

ExTC is under active development and has not been published to Hex. The emulator, sessions, backends and LiveView component work and are covered by the test suite, but the public API is pre-release. MIT licensed.