Structured terminal protocol
HSV Streaming replaces VT100/VT220/xterm escape sequences with structured HSV records. But here's the twist: HSV Streaming separates data from control messages entirely—text content in STX blocks, operations in SOH blocks. This eliminates the complexity of traditional escape sequences, paving the way for more efficient, readable, and secure terminal applications. ESC (0x1B) is forbidden entirely, preventing escape sequence injection attacks that have plagued terminals for decades.
Animation works without any escape sequences at all. Spinners, progress bars, countdowns, status updates—all possible with just CR and BS. The ASCII committee built animation into the data layer in 1963. VT100 escape sequences were never necessary for basic animation; we just forgot the simpler way. Seven ASCII control characters pass through HSV as literal data. Together, they form a complete animation toolkit.
Device Control characters ([DC2]/[DC4]) switch between backend devices, enabling distributed terminal applications.
These bytes pass through HSV unchanged—they're data, not protocol:
| Byte | Hex | Name | Animation Use |
|---|---|---|---|
| BEL | 0x07 | Bell | Audio/visual alert, timing signal |
| BS | 0x08 | Backspace | Overwrite previous character |
| TAB | 0x09 | Tab | Jump to column positions |
| LF | 0x0A | Line Feed | Move down one line |
| VT | 0x0B | Vertical Tab | Move down (tab stop) |
| FF | 0x0C | Form Feed | Page break / clear |
| CR | 0x0D | Carriage Return | Return to line start |
The ASCII committee built animation primitives into the data layer in 1963. We just forgot because VT100 escape sequences took over.
Overwrite a single character in place:
- BS \ BS | BS / BS - BS \ ...
Send -, then BS (0x08), then \, then BS, then |... The character cycles in place.
Rewrite the entire line with CR:
[==== ] CR [===== ] CR [====== ] CR ...
CR (0x0D) returns to column 0 without advancing the line. Overwrite the whole progress bar.
Overwrite digits:
3 BS 2 BS 1 BS G O !
Just send characters with timing delays. HSV Streaming supports baud rate simulation:
[SOH] hsv [US] 1.0 [RS] baud [US] 2400 [STX] [ETX]
At 2400 baud (~240 chars/sec), text appears character-by-character like a real teletype.
Combine CR with content:
Status: Connecting... CR Status: Connected! CR Status: Transferring...
Pad with spaces to clear previous longer text.
Compare with VT100:
\x1b[2K Clear line
\x1b[1G Move to column 1
\x1b[32m Green text
\x1b[5;10H Move to row 5, col 10
\x1b[?25l Hide cursor
CR Return to line start
BS Back one character
LF Down one line
FF Clear/page break
(no cursor hiding needed)
For simple animations, the seven data controls are enough. For structured operations (colors, absolute positioning), use HSV control messages:
[SOH] op [US] attr [RS] fg [US] green [STX] [ETX] Green text
[SOH] op [US] cursor [RS] row [US] 5 [RS] col [US] 10 [STX] [ETX] Move cursor
[SOH] op [US] clear [STX] [ETX] Clear screen
The key insight: separate animation (data layer) from structure (control layer).
An HSV Terminal application can be a single .hsv script file:
# app.hsv - Complete application
[SOH] label [US] start [STX] [ETX]
[SOH] op [US] clear [STX] [ETX]
[SOH] op [US] attr [RS] fg [US] green [STX] [ETX]
[STX] =====================================\r\n [ETX]
[STX] Welcome to MyApp\r\n [ETX]
[STX] =====================================\r\n [ETX]
[SOH] op [US] menu [RS] title [US] Main Menu [RS] items [US] Help [GS] Settings [GS] Exit [RS] goto [US] help [GS] settings [GS] exit [STX] [ETX]
[SOH] label [US] help [STX] [ETX]
[SOH] op [US] clear [STX] [ETX]
[STX] HELP\r\n----\r\n [ETX]
[STX] This is the help screen.\r\n [ETX]
[SOH] op [US] menu [RS] items [US] Back [RS] goto [US] start [STX] [ETX]
[SOH] label [US] exit [STX] [ETX]
[STX] Goodbye!\r\n [ETX]
[EOT]
No compilation. No deployment pipeline. Edit the file, restart the server.
Device Control characters ([DC2]/[DC4]) switch between backend devices:
# Lobby + backend
[DC2] chat [ETX] Connect to chat service
[DC4] Return to lobby
# Database switching
[DC2] db-primary [ETX] Connect to primary database
[DC2] db-replica [ETX] Switch to read replica
# Microservices
[DC2] auth [ETX] Authentication service
[DC2] billing [ETX] Billing service
[DC2] support [ETX] Support ticket system
# IoT / Hardware
[DC2] printer-1 [ETX] Connect to printer
[DC2] sensor-array [ETX] Connect to sensors
# Multi-tenant
[DC2] tenant-acme [ETX] Switch to ACME tenant
[DC2] tenant-globex [ETX] Switch to Globex tenant
Any HSV-speaking service can be a backend. The client doesn't need to know the topology—just the device name.
Combine data controls with baud simulation for a retro dashboard:
[SOH] hsv [US] 1.0 [RS] baud [US] 9600 [STX] [ETX]
[SOH] op [US] clear [STX] [ETX]
[SOH] op [US] attr [RS] fg [US] green [STX] [ETX]
# Header (typed out at 9600 baud)
[STX] ╔══════════════════════════════════╗\r\n [ETX]
[STX] ║ SYSTEM MONITOR v1.0 ║\r\n [ETX]
[STX] ╚══════════════════════════════════╝\r\n\r\n [ETX]
# Update loop - server sends these repeatedly
[STX] CPU: [████████░░] 80% \r [ETX] # CR overwrites line
[STX] CPU: [█████████░] 90% \r [ETX]
[STX] CPU: [███████░░░] 70% \r [ETX]
The client renders at 9600 baud (~960 chars/sec). Updates use CR to rewrite in place. No cursor positioning escapes needed.
| Layer | Purpose | Mechanism |
|---|---|---|
| Data | Content + animation | Text + 7 data controls (BEL BS TAB LF VT FF CR) |
| Control | Structure + formatting | HSV records ([SOH]...[STX]...[ETX]) |
| Protocol | Flow + routing | [ACK]/[NAK], [DC2]/[DC4], [ETB]/[EM] |
Clean separation. Animation is just data with timing. Structure is explicit HSV. Protocol handles the plumbing.
| VT100/xterm | HSV Terminal | |
|---|---|---|
| Escape sequences | Required | Optional (for structure) |
| Animation | Escape codes | Data controls (CR, BS, etc.) |
| Parsing | State machine | Delimiter-based |
| Inspection | Opaque bytes | Human-readable HSV |
| Application format | Code | Script file (.hsv) |
| Security | Escape injection risks | No ESC allowed (forbidden) |