Terminal sessions
The SnapVM terminal is a browser UI connected to a PTY exposed by the agent running inside a machine.
How connection works
Section titled “How connection works”- The browser asks the SnapVM API for authorized access to a machine.
- The console opens a WebSocket connection through the terminal gateway.
- The gateway reaches the agent inside the machine.
- The agent starts or attaches to a PTY session.
- Terminal input and output stream between the browser and the session.
The terminal UI can use renderers such as xterm.js or experimental alternatives when the product exposes a switch.
Reconnect behavior
Section titled “Reconnect behavior”Browser disconnects should not immediately destroy a session. Reopen the terminal to attach again and continue work. Recent output can be replayed from a buffer so the context is not lost.
This is different from hibernation. If the runtime sleeps, in-memory processes can stop. Use services for processes that need to come back automatically.
Multi-attach
Section titled “Multi-attach”Multiple browser tabs can attach to the same session when enabled. Everyone attached to that session sees the same live output and sends input to the same shell.
Use multi-attach for pairing, demos, and support. For independent work, create a separate session so shell history and process state do not collide.
Multiple sessions
Section titled “Multiple sessions”A single machine can have multiple sessions. Use separate sessions for distinct tasks:
- One shell for development commands
- One shell for logs
- One shell for database inspection
- One shell for temporary experiments
The deployment may enforce a maximum session count.
Terminal vs. service
Section titled “Terminal vs. service”| Workload | Best fit |
|---|---|
| Installing tools | Terminal |
| Editing files | Terminal or Code Server |
| Inspecting logs | Terminal |
| Running a development server temporarily | Terminal |
| Keeping a server running after wake-up | Service |
| Starting an agent automatically | Service |
| Restarting on failure | Service |