#pty #tty #terminal

bin+lib tty-web

Web-based terminal emulator — opens a real PTY in the browser over WebSocket

4 releases

Uses new Rust 2024

0.16.4 Jun 26, 2026
0.16.1 Apr 1, 2026
0.16.0 Apr 1, 2026
0.15.1 Mar 25, 2026

#188 in WebSocket

MIT license

4.5MB
1.5K SLoC

Rust 1K SLoC // 0.0% comments JavaScript 266 SLoC // 0.0% comments

Contains (WOFF font, 1MB) LigaHackNerdFont-BoldItalic.woff2, (WOFF font, 1MB) LigaHackNerdFont-Bold.woff2, (WOFF font, 1MB) LigaHackNerdFont-Italic.woff2, (WOFF font, 1MB) LigaHackNerdFont-Regular.woff2

tty-web

Web-based terminal emulator. Opens a real PTY in the browser over WebSocket.

demo

Features

  • Real PTY with full job control, signals, and terminal capabilities
  • Persistent sessions — reconnect without losing state
  • Scrollback replay (configurable, 256 KiB default)
  • Session sharing — multiple clients on one session
  • View mode — read-only observers with automatic window size sync
  • Lightweight binary WebSocket protocol
  • Single static binary (frontend embedded via rust-embed)
  • Multi-arch Docker images (amd64 / arm64) — minimal scratch and playground variants

Quick start

tty-web --address 127.0.0.1 --port 9090 --shell /bin/zsh

Or with Docker:

docker run --rm -p 9090:9090 ghcr.io/alviner/tty-web:playground

The default latest tag is a minimal scratch image for COPY --from:

COPY --from=ghcr.io/alviner/tty-web:latest /tty-web /usr/local/bin/tty-web

Documentation

Full documentation is available at alviner.github.io/tty-web.

Build

make build     # debug
make release   # release
make docker    # docker playground image

Local Docker build (macOS)

Building Docker images on macOS requires cross-compilation to Linux. Install zig and cargo-zigbuild:

brew install zig
cargo install cargo-zigbuild
rustup target add aarch64-unknown-linux-musl  # Apple Silicon
rustup target add x86_64-unknown-linux-musl   # Intel

Then make docker will cross-compile and build the image automatically.

License

MIT

Dependencies

~18–26MB
~387K SLoC