Documentation Index
Fetch the complete documentation index at: https://undyingterminal.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
What is a Persistent Session?
A persistent session is a terminal connection that survives network interruptions, computer sleep/wake cycles, and connection quality issues. Unlike traditional SSH, where a dropped connection kills your running processes, Undying Terminal keeps your session alive indefinitely.How It Works
Session Lifecycle
Component Roles
Server (undying-terminal-server.exe)- Maintains session registry
- Routes traffic between clients and terminals
- Enforces encryption
- Handles authentication
- Manages the actual shell process (cmd.exe, PowerShell, etc.)
- Buffers output using ConPTY
- Survives client disconnections
- Persists until explicitly terminated
- User-facing interface
- Reconnects automatically on disconnect
- Can be closed and restarted without affecting session
Session Recovery
Sequence-Based Protocol
Every packet exchanged between client and terminal has a sequence number. When reconnecting:- Client sends last received sequence number
- Server checks recovery buffer (64MB circular buffer)
- Server replays all missed data
- Session resumes exactly where it left off
Buffer Capacity
| Activity Level | Data Rate | Time Until Buffer Full |
|---|---|---|
| Idle session | ~100 B/s | ~7 days |
| Light typing | ~1 KB/s | ~17 hours |
| Moderate use | ~10 KB/s | ~1.7 hours |
| Heavy logging | ~100 KB/s | ~10 minutes |
Persistence Guarantees
What Survives
Network disruptions:- WiFi disconnects
- Ethernet unplugs
- VPN reconnections
- IP address changes
- Router reboots
- Laptop sleep/wake
- Hibernate/resume
- Screen lock/unlock
- User switching
- Client process killed
- Terminal emulator closed
- Client machine reboot (server keeps session)
What Doesn’t Survive
Server process termination:- Server crash or restart kills all terminals
- Solution: Run server as Windows service
- Manual kill of terminal process
- Server machine reboot
- Shell process exits cleanly
- Running
exitin the shell - Sending
Ctrl+Cto terminal process - Manual cleanup via server
Session Identification
Every terminal session is identified by: Client ID (8-char hex)- Randomly generated when terminal starts
- Used to identify which session to connect to
- Stable across client reconnections
- Enables encryption (XSalsa20)
- Acts as authentication credential
- Required if server configured with
require_key
Comparison to Traditional SSH
| Feature | SSH | Undying Terminal |
|---|---|---|
| Session persistence | No | Yes |
| Survives network drops | No | Yes |
| Output recovery | No | Yes (64MB buffer) |
| Automatic reconnection | No | Yes |
| Multiple simultaneous clients | No | Yes (same session) |
| Windows native | Via Cygwin/WSL | Native Windows |
Session Management
Listing Active Sessions
Server maintains a registry of all active terminals. Connect to server console to view:Terminating Sessions
Graceful exit:Advanced Session Features
Multiple Clients to One Session
Multiple clients can connect to the same terminal session simultaneously:- Screen sharing without screen sharing tools
- Pair programming
- Training/demonstrations
Session Timeouts
Server does NOT implement idle timeouts by default. Sessions remain active until:- Terminal process exits
- Server process exits
- Manual termination
Best Practices
For remote work:- Run server as Windows service (survives server reboots)
- Use encryption (
--key) on untrusted networks - Save connection commands as scripts
- Monitor server logs for security events
- Increase buffer size in server config (if dealing with high output volume)
- Set up monitoring/alerts if server goes down
- Use named sessions (via wrapper scripts) for easier reconnection
- Always use encryption on public networks
- Firewall server port (2022) to trusted IPs only
- Rotate passkeys periodically
- Enable server logging for audit trails
Next Steps
- Learn about Encryption for secure remote connections
- Understand the Recovery Protocol in detail
- Set up Port Forwarding for tunneling