tvterm
What it is
Section titled “What it is”tvterm is “a terminal emulator that runs in your terminal” — it opens terminal sessions inside Turbo Vision windows, so you get a windowed desktop (menus, status line, draggable/resizable windows, dialogs) where each window is a live terminal running a shell or program. libvterm does the heavy lifting of parsing the escape-sequence stream into a screen-cell grid; Turbo Vision renders that grid inside a movable window with the classic Borland chrome. Planned/included features: UTF-8, 24-bit color, fullwidth + zero-width characters, scrollback, selection/search, and text reflow on resize. It’s WIP, but it’s the clearest current showcase of the two libraries that matter here.
For KN-86 the value is two-fold: (1) Turbo Vision is the canonical retro windowed-TUI framework — the Borland-lineage look (blue desktop, drop shadows, double-line dialog borders, a top menu bar, a bottom status line with labeled hotkeys) is the aesthetic ancestor of the kind of UI KN-86 evokes, and studying its object model is studying the grammar of retro-windowed terminal UIs; and (2) libvterm is the reference answer for parsing a terminal escape-sequence stream into a cell grid, which is directly relevant if KN-86 ever hosts a real terminal (the TERM key / REPL / Legacy Terminal mode per ADR-0021). (Reference “CLAUDE.md Canonical Hardware Specification” for the grid; not restated here.)
Turbo Vision — the framework study (the focus)
Section titled “Turbo Vision — the framework study (the focus)”Turbo Vision (Borland, ~1990, now magiblot/tvision) is an object-oriented TUI framework whose vocabulary KN-86’s designers should know by name:
- The desktop metaphor in text — a top menu bar, a bottom status line with labeled hotkeys (
Alt-X Exit,F10 Menu, …), and a desktop surface holding windows. The status line is the direct ancestor of mc’s F-key bar and KN-86’s Row 24 action bar. - Windows + dialogs as objects —
TWindow,TDialog,TView; every on-screen thing is a view in a containment tree. Windows have a frame (title, close/zoom icons, resize corner), are draggable and resizable, and stack with focus. - The signature chrome — double-line dialog borders, single-line window frames, drop shadows (a dim offset on the right/bottom edges), inverted title bars, and labeled buttons (
< OK >,[ Cancel ]). This is the visual grammar most people mean by “retro terminal UI,” and it’s almost entirely glyph-and-inversion, not color-dependent. - Event/command model — events bubble through the view tree; commands are dispatched to whichever view handles them. A clean separation of input → command → view response that any KN-86 windowed surface would want to mirror.
The reason this matters for KN-86’s brand: KN-86 is a retro terminal device. Turbo Vision is the most influential codification of “what a retro windowed terminal UI looks and behaves like.” Even though KN-86 won’t link Turbo Vision (it’s C++/the device is C/SDL3, and KN-86’s surface is a single fixed grid, not a desktop), the chrome conventions and the view/event object model are the canonical reference to draw from and to deliberately echo.
libvterm — escape-sequence parsing
Section titled “libvterm — escape-sequence parsing”libvterm parses a raw byte stream of terminal output (the VT100/xterm escape-sequence language) into a grid of cells (each cell: glyph + attributes), maintaining cursor state, scroll regions, and modes. tvterm feeds a shell’s output into libvterm and renders the resulting cell grid into a Turbo Vision window; the threading model runs the PTY read + libvterm parse and marshals screen updates to the UI.
Relevance to KN-86: if KN-86 ever needs to be a real terminal (the TERM key surface, the onboard REPL, or Legacy Terminal mode per ADR-0021, which is explicitly a mode-swap that hosts bundled terminal titles), it will need exactly this: a component that turns an escape-sequence stream into the 80×25 cell grid. libvterm is the reference implementation and the library to evaluate for that path. It’s the same parse-stream-into-cells problem KN-86’s display layer already solves for its own content; libvterm is the standard solution for foreign terminal streams.
Rendering — monochrome-adaptable
Section titled “Rendering — monochrome-adaptable”tvterm/Turbo Vision are full-color (24-bit, in tvterm’s case). But the chrome that defines the look is monochrome-native: borders are box-drawing glyphs, focus and title bars ride on inversion, depth rides on shadow glyphs and occlusion. Strip the 24-bit color and the Turbo Vision form survives intact on an amber grid — which is the whole point for KN-86. The color in Turbo Vision was always decorative on top of a structure that box-glyphs and attributes already carried.
Single-color adaptation
Section titled “Single-color adaptation”Turbo Vision’s conventions, translated to KN-86’s amber grid:
- Double-line border = dialog/focused; single-line = window/unfocused. Line weight encodes emphasis/focus without color (same finding as desktop-tui.md).
- Inverted title bars mark the active window and serve as drag handles — color-free, legible.
- Drop shadows via the shade-glyph ramp — a one-cell
░-shade offset on right/bottom edges fakes the Turbo Vision shadow on the amber grid. - Status-line hotkey labels — the
KEY Labelpairing (digit/key as affordance, word as label) survives monochrome by typography; it’s the model for KN-86’s Row 24. - Buttons as bracketed labels —
< OK >,[ Cancel ], with the focused button inverted. No color needed to show which button is selected.
The general principle this entry reinforces: the retro-terminal aesthetic KN-86 is reaching for was, at its origin, mostly monochrome-expressible — Turbo Vision’s identity is its glyph geometry and attribute use, not its palette. KN-86 can land the same feel in pure amber.
Navigation / keybindings
Section titled “Navigation / keybindings”Turbo Vision’s conventions (mirrored by tvterm): a top menu bar opened by F10/Alt+letter, a bottom status line of labeled hotkeys, Tab/Shift-Tab to move focus between controls, Alt+hotkey for menu/command shortcuts, and window management (move/resize/zoom/close) via the window’s frame controls or keyboard commands. The model is menu + status-line hotkeys + focus-cycling — a complete, learnable scheme KN-86 can reference for any menu-driven surface.
Architecture
Section titled “Architecture”magiblot/tvision(submodule) — the modern, cross-platform, UTF-8/24-bit-capable port of Borland Turbo Vision. The view/event/command object model and the windowing chrome live here.- libvterm — the escape-sequence → cell-grid parser; the “what’s actually on the foreign terminal’s screen” engine.
- tvterm glue — wires a PTY + libvterm into a Turbo Vision view, marshaling parsed screen updates from the read/parse thread to the UI thread.
- The clean seam is parse (libvterm) ↔ present (Turbo Vision view) — analogous to KN-86’s logical grid ↔ render target seam, and to Brogue’s game buffer ↔ platform backend and php-gameboy’s framebuffer ↔ canvas seams. The whole cluster keeps arriving at the same separation.
Deckline feature inspiration
Section titled “Deckline feature inspiration”- Turbo Vision as the house-style reference for any KN-86 windowed/dialog/menu surface — the chrome conventions (border weight, inverted titles, shadows, bracketed buttons, status-line hotkeys) are the retro grammar KN-86 should deliberately echo. Capture as a reusable UI-pattern set in the authoring docs.
- libvterm for Legacy Terminal mode / TERM / REPL. If/when KN-86 hosts a real escape-sequence terminal (ADR-0021 Legacy Terminal mode is the most concrete case), libvterm is the reference parser to evaluate. Cross-link
docs/adr/ADR-0021-legacy-terminal-mode.md. - Menu-bar + status-line-hotkeys interaction model for menu-driven KN-86 surfaces.
- Batch 8. Brief focus: Turbo Vision framework study + terminal-within-terminal + libvterm. Library shortlist: Turbo Vision (
magiblot/tvision) and libvterm both noted. - Cross-link desktop-tui.md (AppCUI-rs is the Turbo-Vision-lineage Rust framework — same family, different language), mc.md (a hand-rolled terminal widget kit / status-line ancestor), and opentui.md (modern TUI framework). These four are the windowing/TUI-framework spine of the corpus.
- Cross-link
docs/adr/ADR-0021-legacy-terminal-mode.mdfor the libvterm-relevant Legacy Terminal mode path. - Reinforces the cluster’s convergent monochrome finding from the framework/chrome angle: the retro-windowed look is glyph-geometry + inversion + shadow, and was always mostly color-independent.