Terminal & Devbox
The Studio includes a multi-tab terminal connected to a Devbox — a gVisor-sandboxed Linux environment running in the cloud. Every terminal session is a real shell with full access to your repository files.
Devbox
Each repository opened in Studio gets its own Devbox instance. The Devbox is a lightweight container sandbox that provides:
- A full Linux userspace (Ubuntu-based)
- The repository cloned at
/workspace - Standard dev tools:
git,node,npm,python,pip,go,cargo, etc. - Network access for installing packages and running services
- Persistent state across tab switches — your session survives browser reloads
Connection lifecycle
POST /projects/:id/devbox → spawn session
GET /devbox/sessions/:id → poll until phase=ready
POST /devbox/sessions/:id/ticket → mint WebSocket ticket
WS /devbox/sessions/:id/terminal → xterm.js connectionThe terminal auto-reconnects with exponential backoff if the WebSocket connection drops. A status indicator in the terminal header shows the connection state:
| Status | Meaning |
|---|---|
| Connected | Terminal is live and accepting input |
| Reconnecting | WebSocket dropped — attempting to reconnect (up to 6 retries) |
| Error | Connection failed — click Reconnect to retry |
| Terminated | Session ended (e.g. idle timeout) |
Multi-tab terminal
The terminal panel supports up to 5 tabs, each with its own independent Devbox shell session.
| Action | How |
|---|---|
| New tab | Click the + button |
| Close tab | Click the × on the tab |
| Rename tab | Double-click the tab label and type a new name |
| Switch tabs | Click any tab |
Split view
Click the split button (⊞) in the terminal header to show two terminals side by side. Each split side has its own tab bar — you can run different commands simultaneously and compare output.
Terminal features
The terminal is powered by xterm.js and supports:
- Full ANSI color — syntax-highlighted output, colored prompts, etc.
- Auto-resize — the terminal resizes to fit the panel. Resize events are sent to the Devbox (
{type:'resize', cols, rows}). - Copy / paste — standard terminal selection and paste shortcuts
- Scrollback — scroll up to view previous output
- Cendra integration — type natural language and Cendra can interpret it as a command suggestion
Error detection & auto-fix
The terminal automatically monitors output for common error patterns and surfaces them as an actionable banner — no need to scroll through logs to find failures.
How it works
- Terminal output is continuously scanned via WebSocket frame parsing
- When an error pattern is detected, an error banner slides in above the terminal
- The banner shows: ⚠ warning icon, truncated error text (up to 200 characters), a Fix with Cendra button, and a × dismiss button
- Detection is debounced to avoid flashing on multi-line errors
Detected error patterns
The following patterns are detected automatically:
| Pattern | Examples |
|---|---|
| JavaScript errors | TypeError:, ReferenceError:, SyntaxError:, Error: |
| Python errors | Traceback (most recent call last), ModuleNotFoundError: |
| Build errors | npm ERR!, failed to compile, Build failed, cargo error |
| System errors | Permission denied, command not found, ENOENT:, EACCES: |
| Process errors | FATAL, panic:, exit status [1-9], make: *** |
| Module errors | Cannot find module |
Fix with Cendra
Click Fix with Cendra in the error banner to:
- Dismiss the error banner
- Open the Cendra AI panel (if not already open)
- Automatically send a
/fixprompt to Cendra with the error text - Cendra analyzes the error, explains the cause, and writes a fix
Dismiss
Click × to dismiss the error banner without opening Cendra. The banner is simply removed and no further action is taken.
Minimize and restore
Click the − button in the terminal header to minimize the terminal panel. The terminal collapses but stays connected — your session is preserved.
Restore the terminal by pressing Ctrl+` or clicking the terminal toggle in the toolbar.
Toggle
Press Ctrl+` to toggle the terminal panel open or closed.