Stop being the product.
Become the owner.
or
sign uplog in

lanterm: PTY-backed terminal UX toolkit for web apps…

lanterm: PTY-backed terminal UX toolkit for web apps

`Lanterm` is a TypeScript / React toolkit for embedding real PTY-backed terminals into browser applications.

Instead of being a complete web terminal server like `ttyd`, it is intended for cases where you want to compose the terminal UX inside your own application.

### Packages

- `@lanterm/react`: xterm.js-based React terminal surface
- `@lanterm/server`: server-side utilities for connecting PTYs and WebSockets
- `@lanterm/pty`: native PTY binding built with Rust `portable-pty` https://github.com/wezterm/wezterm/tree/main/pty and `napi-rs` https://napi.rs/
- `@lanterm/protocol`: shared message types and codecs between client and server

### Why I made this

With coding agents and browser-based developer tools, there are more cases where I want to do more than just expose a terminal in the browser. I often want to combine the terminal with surrounding UI such as file views, execution history, agent timelines, and dashboards.

I also want to hook into terminal input / output, for example to save execution logs, update UI in response to specific output, or pass terminal activity into an AI agent's context.

Full web terminal servers are useful, but they can be a bit too large when the terminal needs to be integrated with application state and UI. On the other hand, wiring xterm.js and node-pty directly means rebuilding protocol handling, resize behavior, session lifecycle, and React integration each time.

`Lanterm` is meant to sit between those two layers as a library toolkit.
It is still an early release, so I would appreciate feedback on the API design and implementation.
#programming #dev #technology #js
earnings
4,000 mlx total
$0  total
engagement
6 views
0 reactions

0 comments