Explore browser-as-terminal-shell with localhost helper (protocol-handler bootstrap) #3
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/fzt-automate#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Idea
Stop fighting the terminal-vs-browser split. Run the whole UI in the browser and let a small native helper handle the parts only an OS process can do (PTYs, fs, spawn). Use a custom protocol handler (
fzt://or similar) as the bootstrap/trust seam, not the data channel.Shape
fzt://as a protocol handler.fzt.romaine.life, a PWA, orlocalhost) is the entire UI.fzt://spawn?port=<ephemeral>&token=<nonce>.ws://127.0.0.1:<port>with the matching token, spawns a PTY, streams bytes both ways.Protocol handler solves "how does a web page start a local process without an installer prompt every time." WebSocket solves the actual stream. Pure one-shot (no return channel) doesn't work — a terminal needs duplex.
Why this might be better than the current path
<canvas data-ambience>behind the shell becomes free.Risks / open questions
127.0.0.1:<port>. Token-in-URL is fine for first connect; need to think about token rotation, origin pinning (Originheader check on WS upgrade), and what happens if the user has the page open in two browsers.ambience/terminalbecomes lower priority — its open issues (#11–#15) might just get sidestepped rather than fixed.Next step
Spike: tiny Go helper that registers
fzt://, acceptsfzt://spawn?port=&token=, opens a localhost WS, runscmd.exe/pwshthrough a PTY. Browser side: xterm.js page that fires the URL and connects. Goal is "typelsin the browser, see output" — nothing more. Decide from there whether to keep going or fold back into the terminal-native path.