Commit Graph

1 Commits (main)

Author SHA1 Message Date
mula.liu dbc06c77cb The instruments that measured the two lies, on the box itself
`squid-platform::console` now refuses to trust a console's answer about its own
size or about the price of a glyph. It is entitled to that refusal only because
somebody measured both, on the machine, with scripts that could not cheat.

`win-tui-resize.py` grows the console *underneath* a running interface and reads
the screen back, then asks how many columns the right-hand borders sit in: one
column means a screen, two means two frames drawn on top of each other. That is
the resize bug made countable, and its header keeps the five facts about Windows
OpenSSH that shaped it — including that the resize has to be driven on `CONOUT$`,
because after the alternate screen went up, the process asking for the resize is
still describing the buffer nobody is looking at.

`win-tui-widths.ps1` is the same trick applied to a single character: park the
cursor on a known column, write one glyph, read the cursor back, and the cells it
travelled are that glyph's width *in this console*. It measures both write paths
separately — `WriteConsoleW` into the buffer, and encoded bytes through stdout —
because they genuinely disagree, and it reads the cell's contents back too, so a
character the code page quietly replaced cannot hide inside a width that happens
to look right. This is the measurement `symbol_cells` now performs in-process;
the script is what proved the answer was worth asking for, and it still answers
for a console the program cannot see.

`win-tui-clean.ps1` keeps the harness honest: a remote PowerShell left behind by
a dropped ssh session keeps the release binary's file handle open, so the next
build cannot overwrite it, and it later writes its `MARK_QUIT` into whichever
report file exists — a previous round testifying on behalf of this one. It kills
the tested binary and its own grower by command line, and nothing else.
2026-10-15 21:21:19 +08:00