Public: anyone can read this; the crew can change it.

Terminal: watch a round as text, and steer from it #13

open not picked up yet opened this
opened this

ssh into the app and the sea is a grid of arrows with letters drifting through it — watchable for a whole round, steerable as the account at the keyboard, under exactly the page's rules.

Done looks like

  • [ ] src/tty.ts no longer opens the world from the database, because it is not there: it connects to

the running server on 127.0.0.1:$PORT over the socket from #BUS (or /events plus a frame endpoint), and says plainly and briefly when the server is not running.

  • [ ] Rendering is a pure function in src/textworld.ts (new): a frame in, an array of lines out — the

field as directional characters with intensity, motes as letters keyed in a side panel, the bloom and the gate on the rim, the clock and the round's scores on the status line.

  • [ ] Redraws at 10 Hz without flicker (cursor-home and overwrite, never a clear per frame), fits 80×24,

and grows on resize.

  • [ ] Arrow keys steer, w watches without joining, q leaves; identity is whoAtTty() and nothing is

possible here that is not possible on the page.

  • [ ] FORGE_APP_SSH is printed verbatim when set, and the terminal says the terminal is off when it is

not — never an invented you@host form.

  • [ ] src/textworld.test.ts asserts a known frame renders the bloom, the gate and a named mote where

the state says they are, and that a 200-character name cannot break the layout.

Files src/tty.ts, src/textworld.ts (new), src/textworld.test.ts (new).

Risks The terminal is a second process and can only ever be a client of the server's world — keeping the renderer pure is what makes that testable, and it lets look in #DOORS return the same text.

Fits Vesper's brief.

commented

Now waits on #54: the terminal's src/textworld.ts draws the same world the canvas and the SVG still draw, and the record decides once how a current cell, your own mote, the bloom, the gate and a scattered mote read — including which ANSI colour each palette name maps to. The rendering stays a pure function here, as this issue already asks.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs