Skip to main content

Synopsis

undying-terminal.exe [OPTIONS]

Description

The Undying Terminal client is the user-facing component that connects to persistent terminal sessions. It handles interactive I/O, automatic reconnection, port forwarding, and SSH bootstrap.

Connection Modes

Direct Connection

Connect to an existing terminal session:
undying-terminal.exe --connect <HOST> <PORT> <CLIENT_ID> [OPTIONS]

SSH Bootstrap

Start a remote terminal via SSH, then connect directly:
undying-terminal.exe --ssh <HOST> [OPTIONS]

Options Reference

Connection Options

--connect <HOST> <PORT> <ID>

Connect to existing terminal session. Arguments:
  • HOST: Server hostname or IP address
  • PORT: Server port number (typically 2022)
  • ID: Client ID (from terminal output)
Example:
--connect 192.168.1.100 2022 abc123def456

--key <PASSKEY>

Authentication passkey for the session. Required: Yes (with --connect)
Format: Hexadecimal string
Example:
--key 1234567890abcdef

--ssh <HOST>

Bootstrap mode: SSH to host, start remote terminal, connect. Example:
--ssh user@remote-server.com
Behavior:
  1. Spawns ssh to connect to host
  2. Executes undying-terminal-terminal remotely
  3. Extracts client ID and passkey from output
  4. Switches to direct TCP connection
  5. Maintains persistent session

-l, --login <USERNAME>

SSH login username (used with --ssh). Example:
--ssh remote-server.com -l admin

SSH Config Options

--ssh-config <PATH>

Specify a custom SSH config file path instead of the default (~/.ssh/config). Example:
--ssh myserver --ssh-config C:\custom\ssh_config
Behavior:
  • Loads SSH config directives for the specified host
  • Supports: HostName, User, Port, IdentityFile, ProxyJump, LocalForward, ForwardAgent

--no-ssh-config

Disable SSH config file parsing entirely. Example:
--ssh user@192.168.1.100 --no-ssh-config
Use case: When you want to ignore SSH config settings and use only CLI arguments.

-A, --ssh-agent

Enable SSH agent forwarding (passes local SSH keys to remote session). Example:
--ssh myserver -A
--ssh myserver --ssh-agent
Security note: Only enable agent forwarding to trusted hosts.

--no-ssh-agent

Explicitly disable SSH agent forwarding (overrides ForwardAgent in SSH config). Example:
--ssh myserver --no-ssh-agent

--jumphost <HOST>, --jport <PORT>

Connect through intermediate jump server. Example:
--connect jump-server.com 2022 jump-id --key jump-key `
  --jumphost destination-server.com --jport 2022
Flow:
Client → Jump Server → Destination Server → Destination Terminal

Command Execution

-c, --command <COMMAND>

Execute a single command and exit. Format: Command string with newline
Example:
# Note: `r`n for cmd.exe newline
--command "dir`r`n"
--command "echo Hello`r`n"
Behavior:
  • Sends command to session
  • Waits for output
  • Exits on idle timeout
  • Does NOT enter interactive mode

--noexit

Keep client running after command completes (interactive mode). Use with: --connect (default for SSH mode)
Example:
# One-shot command (exits when idle)
--connect ... -c "dir`r`n"

# Interactive session (stays open)
--connect ... --noexit

Port Forwarding

-t, --tunnel <SPEC>

Forward tunnel (local → remote). Syntax:
LOCAL:REMOTE
LOCAL:HOST:REMOTE
BIND:LOCAL:HOST:REMOTE
START-END:START-END
Examples:
-t 8080:9090
# localhost:8080 → remote:9090
Multiple Tunnels:
-t 5432:db:5432 -t 6379:redis:6379 -t 3000:api:3000

-r, --reversetunnel <SPEC>

Reverse tunnel (remote → local). Syntax:
REMOTE:LOCAL
REMOTE:HOST:LOCAL
Examples:
-r 3000:8000
# Server listens on 3000 → client's localhost:8000

Environment Variables

--environmentvariable <NAME>=<VALUE>

Send environment variable to remote session. Example:
--environmentvariable PATH=/usr/local/bin:$PATH
--environmentvariable NODE_ENV=production
Multiple Variables:
--environmentvariable FOO=bar `
--environmentvariable BAZ=qux

Usage Examples

Basic Connection

# Standard interactive session
./undying-terminal.exe `
  --connect 192.168.1.100 2022 abc123def456 `
  --key 1234567890abcdef `
  --noexit

SSH Bootstrap

# SSH with username@host
./undying-terminal.exe --ssh user@remote-server.com

Port Forwarding

# Forward remote database to local port
./undying-terminal.exe `
  --connect db-server.com 2022 <ID> --key <KEY> `
  -t 5432:postgres-internal:5432 `
  --noexit

Jumphost

# Connect through jump server to final destination
./undying-terminal.exe `
  --connect jump.company.com 2022 jump-client-id --key jump-key `
  --jumphost prod.internal.company.com --jport 2022 `
  --noexit

Combined Example

# Full-featured connection:
# - Connect to remote server
# - Forward database and Redis
# - Reverse tunnel for local dev server
# - Set environment variable
./undying-terminal.exe `
  --connect prod-server.com 2022 abc123def456 `
  --key 1234567890abcdef `
  -t 5432:db.internal:5432 `
  -t 6379:redis.internal:6379 `
  -r 8080:localhost:3000 `
  --environmentvariable NODE_ENV=production `
  --noexit

Exit Codes

CodeMeaning
0Success (normal exit)
1Connection failed
2Invalid arguments
3Authentication failed
4Network error
5Protocol error

Environment Variables

These environment variables affect client behavior:

UT_DEBUG_HANDSHAKE

Enable packet-level debugging.
$env:UT_DEBUG_HANDSHAKE = 1
./undying-terminal.exe --connect ...
Output: Prints packet types sent/received

UT_PIPE_NAME

Override named pipe path (when connecting to non-default server).
$env:UT_PIPE_NAME = "\\\\.\\pipe\\undying-terminal-custom"
./undying-terminal-terminal.exe

Common Patterns

Connection Script

Save frequently-used connections:
# connect-dev.ps1
$clientId = "abc123def456"
$passkey = "1234567890abcdef"

./undying-terminal.exe `
  --connect dev-server.com 2022 $clientId `
  --key $passkey `
  -t 5432:db:5432 `
  --noexit
Usage:
.\connect-dev.ps1

Health Check Script

Check if session is responsive:
# health-check.ps1
$output = ./undying-terminal.exe `
  --connect 127.0.0.1 2022 $clientId `
  --key $passkey `
  -c "echo OK`r`n"

if ($output -match "OK") {
  Write-Output "Session healthy"
  exit 0
} else {
  Write-Output "Session unresponsive"
  exit 1
}

Automated Deployment

# deploy.ps1
./undying-terminal.exe `
  --connect prod-server.com 2022 $clientId `
  --key $passkey `
  -c @"
cd C:\apps\myapp
git pull origin main
npm install
npm run build
Restart-Service MyAppService`r`n
"@

Comparison with Other Terminals

vs. SSH

FeatureUndying TerminalSSH
Session PersistenceYes AutomaticNo Drops on disconnect
RecoveryYes Packet-levelNo None
ReconnectionYes AutomaticNo Manual
Port ForwardingYes Persistent tunnelsYes Drops on disconnect
Windows NativeYes YesWarning: Requires WSL/OpenSSH

vs. tmux/screen

FeatureUndying Terminaltmux/screen
Session MultiplexingNo Single session per terminalYes Multiple panes
Network ResilienceYes Built-in recoveryYes Via SSH wrapper
Windows SupportYes NativeNo Requires WSL
Port ForwardingYes Built-inNo Requires SSH

vs. Eternal Terminal (ET)

FeatureUndying TerminalET
ProtocolET-compatibleET protocol
PlatformWindowsLinux/macOS
ArchitectureClient-Server-TerminalClient-Server
ConPTYYes YesNo No

Debugging

Enable verbose output:
# Debug handshake
$env:UT_DEBUG_HANDSHAKE = 1

# Run client
./undying-terminal.exe --connect ... --noexit
Check connection:
# Verify server is reachable
Test-NetConnection -ComputerName prod-server.com -Port 2022

# Check client process
tasklist | findstr undying-terminal.exe

Next Steps