Skip to content

viachq/termhost

Repository files navigation

termhost

Your Windows terminals, in your pocket. A terminal workspace for your PC and a remote control for it on your phone — one app.

termhost is a Windows terminal multiplexer (think tmux, but with a GUI) whose terminals live in a background daemon and are reachable from any device: work in split panes on your laptop, then pick up your phone and keep driving the very same terminals from the couch, the street, or another machine. No SSH app, no account, no cloud — your PC serves everything itself.

Built for the age of AI coding agents: the most common use case is controlling Claude Code, Codex, or opencode running on your PC from your phone — watching the agent work, answering its prompts, sending it a photo — while your laptop stays on the desk.

⚠️ Early development. Windows-first (PowerShell + ConPTY); the mobile client works in any modern browser.


What you get

🖥️ A real terminal workspace on the desktop

  • Split panes — binary-tree layout with keyboard-driven splits, focus navigation, resize, and per-pane zoom/maximize
  • Workspaces — named sets of terminals with their own working directories and startup commands, restored on launch
  • Side panels — file explorer with Monaco editor and Markdown preview, embedded browser, git panel, SSH panel, MCP panel
  • GPU-rendered terminals — xterm.js with the WebGL addon, image support, clickable links, search
  • Native, not Electron — Tauri 2 + Rust, small footprint, instant startup

🔌 Terminals that survive

All PTYs are owned by a small Rust daemon (termhostd), not by the app window. Close the app, restart it during development, crash the UI — your shells and running agents keep going. Reopen the window and reattach. The daemon sits in the tray and can keep the machine awake while remote access is on.

📱 Your terminals on your phone

The daemon serves a PWA straight from your PC — open one URL on your phone, install it to the home screen, and you have every terminal from your desktop:

  • Faithful rendering of TUIs — the daemon keeps a server-side vt100 screen for each terminal, so Claude Code's interactive UI, menus and colors render correctly the moment you connect (no garbled replay)
  • Two clients, one terminal, no fighting — "active client wins" size negotiation: tap the phone and the PTY reflows to phone width; click the desktop pane and it snaps back
  • A keyboard that understands agents — Esc, Ctrl+C, arrows, Tab, ⇧Tab (Claude Code mode cycle), Enter, plus a collapsible strip of extras
  • Send a photo into your workflow — attach an image from the phone; it lands on the PC clipboard ready to paste into Claude Code
  • Spawn new terminals from the phone, switch between them, send clipboard text straight into any PTY
  • Survives mobile networks — exponential-backoff reconnect on tower handoffs and screen locks, full screen repaint on reconnect
  • Zero-typing auth — a per-daemon token is injected into the served page automatically; the WebSocket and file endpoints reject anything without it

🌐 Connect from anywhere

Your PC is the server. On your LAN, open http://<pc-ip>:9090 — done. Away from home, bring your own tunnel:

  • Tailscale — the daemon detects and prints your tailnet URL alongside the LAN one
  • Cloudflare Tunnel — nothing to install on the phone, zero phone battery cost

No relay servers, no telemetry, no account. Self-hosted in the most literal sense: it's your laptop.


How it works

┌────────────── your PC ──────────────┐
│                                     │
│  termhost.exe (Tauri 2 + React)     │
│  desktop workspace UI               │
│        │ named pipe IPC             │
│  termhostd.exe ──────────────┐      │
│  Rust daemon in the tray     │      │
│  • owns every PTY (ConPTY)   │      │
│  • vt100 screen per terminal │      │
│  • token auth                │      │
│  • warp WS/HTTP server :9090 │      │
└──────────────────────────────┼──────┘
                               │ WebSocket
                 LAN · Tailscale · Cloudflare Tunnel
                               │
                ┌──────────────┴─────────────┐
                │  phone / tablet / any PC   │
                │  PWA (React + xterm.js)    │
                └────────────────────────────┘

The desktop UI is just another client of the daemon — which is why terminals outlive it, and why your phone sees exactly the same sessions.


Getting started

Prerequisites: Windows 10/11, Node.js ≥ 20, Rust stable.

git clone https://github.com/viachq/termhost
cd termhost
npm install
npm run dev          # dev build: Tauri window + vite dev server

Production build:

npm run build        # builds the mobile PWA bundle, then the Tauri app

Phone access: launch the app → Settings → Remote Access → open the printed URL on your phone (LAN and Tailscale URLs are both shown), then "Add to Home Screen".


termhost vs. the alternatives

termhost ttyd / wetty VibeTunnel / 9remote / ccpocket claudecodeui tmux + SSH app cmux / wmux
Full desktop workspace (panes, files, git)
Terminals survive UI restarts ✅ daemon varies wmux only
Phone client tuned for TUIs/agents ❌ raw ⚠️ SSH app needed
Agent-agnostic (any CLI, not a wrapper) ✅ any PTY varies ❌ Claude-centric
Correct TUI render on connect (server-side screen) ✅ vt100 varies n/a n/a
Windows-native, no WSL ⚠️ varies ⚠️ wmux only
Self-hosted, no account varies

The gap termhost fills: projects in this space are either a workspace (cmux, wmux) or a remote channel (ttyd, VibeTunnel, ccpocket) — termhost is the place your terminals live and every way you reach them.


Tech stack

  • Desktop: Tauri 2, React 19, TypeScript, Zustand, CSS Modules, xterm.js (WebGL), Monaco
  • Daemon: Rust — portable-pty (ConPTY), warp (HTTP/WS), vt100, tray-icon, arboard
  • Mobile: React + xterm.js compiled to a single self-contained mobile.html, served by the daemon; PWA manifest
  • IPC: named pipes (app ↔ daemon), WebSocket (clients ↔ daemon), token-authenticated

Roadmap

  • Attach files/photos directly into the agent's prompt (path injection, not clipboard)
  • Service worker → full offline-capable PWA install
  • Screen view — see the desktop, not just terminals
  • Connect to remote servers' daemons, not only the local PC
  • Terminals that survive daemon updates (session host process)
  • Linux/macOS desktop build (Tauri is already cross-platform)

Status

Actively developed and used daily by its author to drive Claude Code from a phone. Expect rough edges and breaking changes; issues and ideas are welcome.

License

MIT


Keywords: remote terminal, Windows terminal multiplexer, control Claude Code from phone, mobile terminal, tmux alternative for Windows, PWA terminal, self-hosted remote access, AI coding agent remote control, xterm.js, Tauri, Rust, ConPTY.

About

Your Windows terminals, in your pocket — terminal workspace with split panes whose terminals live in a daemon and are reachable from your phone (PWA). Drive Claude Code / Codex / any CLI agent remotely. Tauri + Rust + React.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors