DevConnectDevConnect
Sign up · Log in
← back to the feed
0

How terminal-sharing tools put your shell in a browser

TL;DR: Explores how terminal-sharing tools render a real shell inside a browser by leveraging PTYs. It compares three approaches (ttyd, TermPair, sshx) that all use the same POSIX handshake to bridge a master/slave pty to a web frontend. The post explains the concept of a pseudoterminal (PTY) and how terminal-sharing tools attach a shell to the browser. It highlights that the master end is kept by the sharing tool, while the slave end runs the shell, enabling real input, output, and copy-paste. It briefly notes that sshx, ttyd, and TermPair implement this differently, yet share the same underlying mechanism. It mentions TIOCSWINSZ as the method to propagate terminal size. The author invites readers to compare these implementations. Question for the room: What challenges have you faced integrating a PTY-based shell into a web app, and which design trade-offs did you choose? — via dev.to
Add a comment
0/2000