# Terminal OS key remap comparison

Run the attached scenario from a dependency-installed worktree of current main. Apply the attached `headed-runner.patch` to the scenario runner only; it forwards `--headed` and omits intermediate stability frames from the paired evidence table. It does not change either app checkout.

Requirements: Linux X11, Xvfb, Python 3, libX11, libXtst, setxkbmap, xmodmap, xkbcomp, Vim, and the runner's Chromium build.

Start an isolated X server on a free display, retain its PID, and set `DISPLAY` to that display. The recorded run used an Xvfb screen of 1280x800x24.

```sh
DISPLAY=:141 T3_SCENARIO_INHERIT_ENV=DISPLAY T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/terminal-os-remaps-proof.e2e.ts --base 966d23455c754d9b4e368b3570faf46533bb258c --head f12f5ec8218b096fb009a51820cea0d80b632fe8
```

The runner starts each commit's actual server and web client with fresh isolated state and `--no-seed`. The scenario creates its synthetic project and replay thread through T3's APIs. Physical X11 keycodes are injected through XTest, and browser event logs confirm `isTrusted: true`; no DOM KeyboardEvent is dispatched. Keycodes 66 and 9 exercise `caps:swapescape`. Additional XKB remaps exercise Delete→Backspace, Backspace→Delete, Up→PageUp, Down→PageDown, Left→Home, and Right→End. The raw-mode helper is a terminal program that reports actual bytes received on its stdin, not a provider or service substitute.

The same light theme, viewport, synthetic data, collapsed sidebar, neutral shell prompt, and nonblinking cursor are used on both commits. Each selected still follows two byte-identical screenshots at least 500 ms apart. Intermediate frames are retained by e2e but omitted from the proof table. Recording begins after setup and clearing the terminal, and ends after the vim flow.

The vim flow waits for Vim's startup command, enters insert mode, types `hello`, captures insert mode, presses physical Caps Lock with `caps:swapescape`, then types `:wq` and Enter. The shell prints the saved file only after vim exits. Base remains in insert mode with `hello:wq`; head exits and the real file contains `hello` plus a newline.

Restore the XKB mapping and stop the isolated X server by its retained PID when finished. No product changes or commits are needed.
