Let the console edit a line, and let a file be a keyboard

BACKSPACE REACHED THE SHELL. A terminal in line mode does not hand a program every
keystroke: it collects a line, rubs out a backspace, and delivers the finished thing at
Return. CosmOS has always relied on that, and behind a window there is no terminal to do it,
so the raw 0x08 went into the command buffer. Correcting a typo produced a line that looked
perfectly right on the screen and matched no command at all - "I do not know: help".

So the console does it, because behind a window the console IS the terminal. In key mode it
does not, and must not: a program in key mode asked for every keystroke as it happens.

CosmOS now asks for eighty columns at boot. Its own help text is seventy-four characters
wide, and dir, the monitor and the assembler's messages all assume room. The machine still
wakes up in the smaller mode, which is right for a machine - it is the system that knows
what shape of screen its own output needs, and a game that wants forty columns says so.

AND A FILE CAN BE A KEYBOARD, which is the part that matters beyond today. The console
behind a window is not the console behind a terminal, and until now the difference was
unreachable: it broke twice in two days and a person typing found it both times. --keyboard
installs the same hook a window does, so the same path runs, and the manifest has a column
for it. cosmosTyped types "halp", backs over it, arrives at "help", and requires the help to
come out. Verified by removing the rub-out, which loses the whole help text.

It does not test the window. Voyager's key queue and everything about presenting frames are
still out of reach. It tests the console, which is where the logic is.

Along the way: VOY_OBJS was missing from the dependency include, so voyager.o never rebuilt
when a header changed. EmulatorOptions grew a field, Voyager kept an object that disagreed
about the size of the struct, and smashed its stack on every run. A clean build hides it and
'make sanitize' cleans first, so that would never have found it either. Tests/voyager.sh did,
by failing all 115 tests that start the machine - which is the differential test earning its
keep on a bug that has nothing to do with what it was built to check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-08-28 23:39:35 -04:00
co-authored by Claude Opus 5
parent 761c11a66b
commit 978aec4809
11 changed files with 214 additions and 17 deletions
+16 -1
View File
@@ -78,7 +78,7 @@ from `make`, not from here.
### 1. Recorded output
`Tests/run.sh` assembles each program named in `Tests/manifest`, runs it, and compares
everything it printed against a file in `Tests/expected`. 165 tests, of which 103 run, 35
everything it printed against a file in `Tests/expected`. 166 tests, of which 104 run, 35
only assemble, 16 are expected to fail to assemble, and 11 boot from ROM with no image
given at all.
@@ -328,6 +328,21 @@ The `@N` form deserves a note. Every other test runs with the disk's answer avai
before the next instruction, which is the one condition under which failing to wait looks
exactly like working.
**keys** names a file in `Tests/input` to be fed to the console as a *keyboard* rather than
as standard input, and the difference between those is the whole reason the field exists.
Standard input reaches a console that believes a terminal is doing the line editing, which
is true when there is one: the terminal collects a line, rubs out a backspace, and hands
over the finished thing at Return. **Behind a window there is no terminal**, so the console
does that itself, and that is real logic which nothing could reach. It broke twice in two
days and a person typing found it both times - once as keys that never arrived, once as a
corrected line that reached the shell with the backspaces still in it, looking perfectly
right on screen and matching no command at all.
A keyboard file installs the same hook a window does, so the same path runs. It does not
test the window: Voyager's own key queue is still out of reach, and so is anything about
presenting frames. It tests the console, which is where the logic is.
## Fixture Disks:
`Tests/makedisks.sh` builds 26 images with SplitDisk before anything runs, into