Terminal Access
Full shell access from your mobile device with PTY terminal support.
Overview
C3 includes a full-featured terminal that gives you shell access to your development machine from your mobile device. It's a real PTY (pseudo-terminal), so interactive commands, vim, and other terminal apps work just like on your desktop.
Use cases for mobile terminal:
- Running build commands and tests
- Checking logs and debugging
- Git operations
- Starting and stopping services
- Quick file operations
- Running scripts and tools
Accessing the Terminal
Open the terminal from the chat screen toolbar:
- Open any project and navigate to the chat screen
- Tap the terminal icon in the app bar (top right corner of the screen)
- The terminal opens and connects automatically
- Your shell starts in the project's working directory
Automatic Connection
Terminal authentication is handled automatically. The terminal credentials are exchanged right before connecting. You don't need to enter credentials separately — just tap the terminal icon and you're connected.
Server Connection Required
The terminal requires an active connection to your C3 backend. Make sure the server is running before accessing the terminal.
Terminal Toolbar
The terminal includes a toolbar above the keyboard with three tabs for quick access to special keys and commands. Tap a tab name to switch between them.
Keys Tab
Modifier and special keys that aren't available on mobile keyboards:
- CTRL — Toggle on, then tap a letter key (C, V, D, Z, L, A, X) for shortcuts
- SHIFT — Toggle on for uppercase or shift combinations
- ESC — Exit modes in vim, cancel operations
- TAB — Autocomplete commands and paths
- ENTER — Execute command
- Arrow keys — Navigate command history and cursor
- F — Toggle to show function keys (F1-F12)
When CTRL or SHIFT is active (highlighted), common letter keys appear for quick combinations like Ctrl+C, Ctrl+V, Ctrl+D, etc.
Commands Tab
Platform-specific common commands for quick execution. The commands shown depend on your server's operating system:
- macOS/Linux: ls, clear, pwd, exit, cd, cat, nano, vim, mkdir, rm, cp, mv, grep, chmod, sudo, touch, find, tail, head, less
- Windows: dir, cls, cd, exit, type, notepad, code, mkdir, del, rmdir, copy, move, findstr, icacls, runas, where, more, tree
- Cross-platform: git, npm, node, python, pip
Some commands auto-execute immediately (like ls or clear), while others insert a prefix for you to complete (like cd or grep ).
Favorites Tab
Create and manage your own collection of frequently used commands:
- Tap the + button to add a new favorite
- Enter a label (display name) and the command to run
- Optionally enable Auto-execute to run immediately on tap
- Tap a favorite to insert or execute it
- Long-press a favorite to remove it
Favorites are saved per project, so each project can have its own set of commonly used commands.
Clipboard Paste
With CTRL and SHIFT both active, tap V to paste from your device clipboard directly into the terminal.
Using the Terminal
Basic Usage
- Type commands using your on-screen keyboard
- Press Enter to execute
- Output appears in the terminal with ANSI color support
- Scroll up to view previous output
Interactive Applications
The terminal fully supports interactive applications:
- vim / nano / emacs — Text editors work with full key support
- htop / top — System monitoring with live updates
- npm/yarn prompts — Interactive CLI tools and wizards
- git interactive — Rebase, staging, diff viewing
- SSH — Connect to remote servers
External Keyboard Support
If you connect a Bluetooth or USB keyboard to your device:
- All standard keyboard shortcuts work (Ctrl+C, Ctrl+Z, etc.)
- Arrow keys navigate directly
- Tab completion works as expected
- The toolbar remains available for quick command access
Terminal Size
The terminal automatically adjusts to your screen size. For complex TUI applications, landscape mode provides more columns for better display.
Session Management
Session Persistence
Terminal sessions are managed per project:
- Each project maintains its own terminal session
- Sessions persist for 5 minutes after disconnecting
- Reconnecting within the timeout restores your full session state
- Command history and working directory are preserved
Auto-Reconnection
If your connection drops (network switch, sleep, etc.):
- The terminal automatically attempts to reconnect
- Reconnection uses exponential backoff to avoid overwhelming the server
- A connection status indicator shows the current state
- Your session is restored once reconnected
Session Limits
The server enforces resource limits for stability:
- Maximum 5 concurrent terminal sessions
- Oldest idle sessions are cleaned up first if limit is reached
- Each session maintains up to 100KB of scrollback buffer
Long-Running Commands
Commands continue running even if you switch away from the terminal. When you return, you'll see the accumulated output. For very long operations, consider using screen or tmux for extra resilience.
Security
Authentication
Terminal access is protected by multiple security layers:
- WebSocket connections require valid authentication tokens
- Credentials are exchanged securely during server connection setup
- Each session is bound to your authenticated client
Rate Limiting
To prevent brute-force attacks:
- Failed authentication attempts are tracked per IP
- After 5 failed attempts, the IP is blocked for 15 minutes
- This protects your terminal from unauthorized access
Network Security
- Local network: Traffic stays on your private network
- ngrok/remote: All traffic is encrypted via TLS (HTTPS/WSS)
Full Access Warning
Terminal access provides the same permissions as if you were at your computer. Anyone with access to your C3 connection can run any command your user account can execute. Keep your connection credentials secure.
Best Practices
- Use HTTPS (ngrok) for remote access over public networks
- Don't share your server connection QR code or credentials
- Restart the server to regenerate credentials if compromised
- Be cautious running destructive commands (rm -rf, etc.)