「‍」 Lingenic

Terminal Applications

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.

The Seven Data Controls

These bytes pass through HSV unchanged—they're data, not protocol:

ByteHexNameAnimation Use
BEL0x07BellAudio/visual alert, timing signal
BS0x08BackspaceOverwrite previous character
TAB0x09TabJump to column positions
LF0x0ALine FeedMove down one line
VT0x0BVertical TabMove down (tab stop)
FF0x0CForm FeedPage break / clear
CR0x0DCarriage ReturnReturn to line start

The ASCII committee built animation primitives into the data layer in 1963. We just forgot because VT100 escape sequences took over.

Animation Patterns

Spinner

Overwrite a single character in place:

-  BS  \  BS  |  BS  /  BS  -  BS  \  ...

Send -, then BS (0x08), then \, then BS, then |... The character cycles in place.

Loading... /

Progress Bar

Rewrite the entire line with CR:

[====      ]  CR  [=====     ]  CR  [======    ]  CR  ...

CR (0x0D) returns to column 0 without advancing the line. Overwrite the whole progress bar.

Downloading: [================ ] 80%

Countdown

Overwrite digits:

3  BS  2  BS  1  BS  G  O  !
Starting in: 1

Typewriter Effect

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.

Status Line Updates

Combine CR with content:

Status: Connecting...  CR  Status: Connected!     CR  Status: Transferring...

Pad with spaces to clear previous longer text.

No Escape Sequences

Compare with VT100:

VT100 (escape sequences)

\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

HSV Data Controls

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).

Script-Driven Applications

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.

Distributed Architecture

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.

Example: Live Dashboard

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.

Why This Works

LayerPurposeMechanism
DataContent + animationText + 7 data controls (BEL BS TAB LF VT FF CR)
ControlStructure + formattingHSV records ([SOH]...[STX]...[ETX])
ProtocolFlow + routing[ACK]/[NAK], [DC2]/[DC4], [ETB]/[EM]

Clean separation. Animation is just data with timing. Structure is explicit HSV. Protocol handles the plumbing.

Comparison

VT100/xtermHSV Terminal
Escape sequencesRequiredOptional (for structure)
AnimationEscape codesData controls (CR, BS, etc.)
ParsingState machineDelimiter-based
InspectionOpaque bytesHuman-readable HSV
Application formatCodeScript file (.hsv)
SecurityEscape injection risksNo ESC allowed (forbidden)