Repository navigation
test(terminal-env): read the stand-in core's environment only once it runs - #3661
Conversation
… runs Bun.spawn returns the pid before the child runs /bin/sh, and until then /proc/<pid>/environ shows the test's own environment, so "fits the terminals to the running core's own environment" failed when its read came first (64 of 200 runs at 8 copies on main). The stand-in now prints a line once it runs and the test reads /proc after it. A real core has answered server.status before it is read, so the product is unaffected.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
One reviewer: test-only PR (one unit test file). Test-only PR ( It closes a unit flake that #3652 brought to |
… 0.5.2 (#3550) (#3664) Owner approved removing the ring on 2026-11-11: this takes out a design-pass element (#3431's keyboard-focus ring around the terminal) and brings back the 0.5.1 look. Fixes #3550 ## Cause #3431 (the 0.5.2 design pass) added three rules to `src/components/PaneTerminal.css`: an accent outline on `.pane-terminal:focus-within`, plus inset accent box-shadows on `.xterm` and `.xterm-viewport`, as a ring showing where keys go. Its PR and changelog did not mention it. In Terminal mode it draws a line around the terminal whenever the terminal has the focus, which is always once you click into it; Safari shows it most plainly as a blue line under the tab row. ## Change The three rules are removed. Nothing replaces them: the terminal's own cursor shows where keys go, and the current pane's head already takes the accent and a heavier title (`.pane-frame.is-current`). No other keyboard-only indicator was added, since any ring on the xterm textarea also shows for a mouse click (a textarea matches `:focus-visible` however it was focused). The cursor is the focus indicator, as in standalone terminals such as Ghostty and iTerm2, which draw no ring around a focused terminal; this is also how 0.5.1 looked. ## Design gate `bun scripts/design-gate-qa.ts --surfaces terminal-view,split-panes --checks focus,contrast`, in the CI runner image, with main's CSS as the baseline: 4 NEW findings, all `focus-contrast` on `textarea.xterm-helper-textarea "Terminal input"` (1.00:1 < 3:1, the hidden textarea's own outline) on `terminal-view` and `split-panes` at 1440, light and dark; nothing RESOLVED. They are the ring this PR removes on purpose, approved by the owner as above, so they are expected, not a reason to hold the PR. CI does not run the design gate. ## Screenshots A shell pane in an owned herdr test workspace, Terminal mode, the terminal focused, light theme. | | Desktop 1280 | Phone 390 | |---|---|---| | Before (main) |  |  | | After |  |  | ## Validation - `scripts/terminal-keyboard-demo-regression.ts`, in the CI runner image (`herdr-ci-runner:local`): a new assertion that the focused grid draws no outline or inset ring. It fails with main's CSS and the whole script passes with this change. - The design gate run above. - `bun run check fast`: workflow syntax, generated types and themes, typecheck and build ok; unit tests failed only `server/herdr-core/terminal-env.test.ts`, a flake on main at the time, since fixed by #3661.
Change
Test-only fix for a new flaky unit test from #3652:
server/herdr-core/terminal-env.test.ts, "fits the terminals to the running core's own environment, else to the one that starts it" (expect(...).toMatchObjectat line 57). It failed in a localbun run check faston main df59ebd, with the same code asmain.Cause
The test starts
/bin/sh -c "read _"with its own environment as a stand-in for the running core, then reads that process's environment from/proc/<pid>/environ.Bun.spawnreturns the pid as soon as the child is forked, before it runs/bin/sh. Until then,/procshows the test's own environment, so a read that comes first finds neitherPATH=/usr/bin:/core/toolsnorNO_COLOR=1. A real core has already answeredserver.statusbefore it is read, so production code is not affected.Fix
The stand-in prints a line once it runs (
echo started; read _), and the test reads/proconly after that line arrives. No sleep, no timeout, no product change.Validation
main: 64 of 200 failed;bun run check fast: pass (unit 16109 pass, 0 fail).check full. Test-only, so no changelog fragment.