Add a --terminal flag that exposes a WebSocket endpoint at /.terminal for interactive shell access. Combined with an xterm.js pane, this gives pod owners a full terminal in the browser.
Implementation
~30 lines in the WebSocket handler:
import{spawn}from'child_process'// On WebSocket connect to /.terminalconstshell=spawn('/bin/sh',{env: process.env})ws.on('message',data=>shell.stdin.write(data))shell.stdout.on('data',data=>ws.send(data))shell.stderr.on('data',data=>ws.send(data))shell.on('exit',()=>ws.close())
Developers using losos as a phone OS / pod browser need shell access. Rather than installing ttyd as a separate process, JSS provides it natively. The terminal pane in nosdav/browser connects xterm.js to this endpoint.
Activity
Add --terminal flag for WebSocket shell access. Fixes #234