The window is not the session
In a traditional terminal app, closing the interface usually closes the processes. That is reasonable until an agent has worked for twenty minutes or a build has decided to compile the universe.
We split responsibilities. Electron owns the interface; a local daemon owns the PTYs. They communicate over WebSocket on `127.0.0.1` with a dedicated token. The interface can disappear and return. The work stays put, quietly pleased with itself.
Return without losing scrollback
Keeping the process alive was not enough; reopening also needed to rebuild what was on screen. A headless terminal serializes the state with its SGR colors. Each session also keeps a raw ring buffer as a fallback.
The result feels continuous. It is not teleportation—just snapshots, buffers, and a healthy respect for text that already crossed the screen.
The least glamorous detail
During development, the Electron binary wanted to store its data elsewhere. Passing the same user-data directory to the daemon fixed it. One small command-line argument, one large reduction in ghosts.