Controls & Hotkeys
LMESH provides low-level keyboard hotkeys, automated PTY synchronization hooks, and collaborative token-passing mechanisms to manage active shell sessions securely without leaving your terminal.
Hotkey Quick Reference
These hotkeys are captured directly by the host CLI input stream and intercepted before reaching the child shell process:
| Shortcut | Scope | Action | Description |
|---|---|---|---|
| Ctrl+S | Host CLI | Toggle Private | Enables or disables automatic secrets redaction in collaborator viewports and audit logs. |
| Ctrl+] | Host CLI | Terminate | Immediately tears down the active WebSocket stream and terminates the native PTY session. |
| exit | Shell Process | Process Exit | Standard shell exit command. Triggers SIGHUP signal propagation and closes the session. |
| Escape | Host CLI | Revoke Control | Instantly reclaims terminal write access back to the host, demoting collaborators to viewers. |
Private Mode (Ctrl+S)
securityDuring live pairing, hosts often need to inspect environment variables, run migration scripts containing database connection URIs, or copy sensitive tokens. Private Mode acts as an in-stream redaction proxy between the local PTY stdout and the outbound WebSocket relay.
Automatically scans stdout chunks for regex patterns matching AWS access keys, GitHub personal access tokens, OpenAI API keys, private RSA keys, and JWT signatures.
Masked strings are replaced with [REDACTED] before chunks are pushed to PostgreSQL session history tables.
Session Termination (Ctrl+])
lifecycleWhen you conclude collaboration, you can disconnect all connected web clients and destroy the relay session using either the escape chord or the shell exit command:
Immediately broadcasts a session termination payload over WebSocket, closes the server room, and returns the host shell to ordinary non-shared operation.
Typing exit inside the terminal sends an EOF (End of File) signal to your underlying shell, naturally terminating both the PTY process and the session.
Terminal Redraw & Viewport Sync
renderingCollaborative terminal streaming faces a physical challenge: browser windows and desktop terminal windows have differing column and row geometries. LMESH synchronizes viewport dimensions without distorting full-screen TUI programs such as Vim, Nano, or htop.
- Host Authority: The host's physical terminal window dimensions (
colsandrows) define the authoritative PTY size. - Viewport Clamping: Collaborator browser viewports instantiate an xterm.js canvas fitted with dynamic letterboxing when client monitors are larger or smaller than the host terminal.
- Window Change Signal: When the host resizes their terminal window, the CLI emits a
SIGWINCHevent to the PTY and pushes a resize frame over WebSocket to redraw collaborator viewports immediately.
Input Token Handover
collaborationTo prevent simultaneous keystroke collisions and command corruption, LMESH implements a Single-Token Write Mutex. Collaborators begin in read-only observation mode.
Collaborator clicks "Request Control" in the web toolbar.
Host approves prompt in CLI or browser dashboard.
Token transfers to collaborator. Host retains instant revoke with Escape.