Claim the TUI before boot and paint live markdown - #666
Closed
justrach wants to merge 3 commits into
Closed
Conversation
The Zig boot phases are ~12ms; the delay is staring at the leftover shell until tui.run writes the alt-screen. Claim that screen at runSubcommand for `tui`/`repl` so keys/MCP/prompt happen inside the pager, and restore via atexit if we never reach run. Live TUI tail and zigzag repl pending used sanitize/strip only, so - lists and **bold** stayed raw until the turn settled. Render them the same way a settled assistant row does; keep raw bash plain.
The pager paints through layout_cache, not scrollback.render, so the live stream was still sanitize-only. Share liveTail. Skip a second enable_seq after an early claim — kitty keyboard is a stack, and the extra push failed PTY mode-balance.
Early claim pushed kitty/mouse before boot, then skipped the loop's enable write. Hover never tinted and a second push unbalanced kitty. Claim is now ?1049h/?25l plus a wipe; run re-asserts raw and writes the full enable string exactly once.
Owner
Author
|
Already on main via the 281 cut (#670 / ADR 0042). Closing as superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Zig boot phases on this tree are about 12ms. The delay is staring at the leftover shell until
tui.runwrites the alt-screen. FatAGENTS.md, plugin consent, and companion spawn make that gap seconds on a real machine.This claims the pager as soon as the command is
tuior TTYrepl— alt-screen + wipe only — so leftover boot happens inside the pager. Kitty/mouse/paste stay onrun's singleenable_seqwrite (they are a stack). If we never reachrun, shutdown stamps and the panic/signal hooks restore the shell.Live TUI tail (layout cache, not just
scrollback.render) and zigzaggraff replpending now use the same markdown renderer as a settled assistant row. Raw bash stays plain. Line REPL already streamed markdown when color is on.Pi / SWE-bench
Not official SWE-bench Harbor. Local suite is
graff-evals --suite swe(6 DeepSWE-shaped tasks). ADR 0024 compared graff vs grok-build, not Pi: latest recorded shape is graff default rlm 5/6 at ~9M RSS / ~4 calls per task; grok-build 5/6 at ~160–177M RSS. Both misslabel-sort. Pi is wired aspi/pi-codegraffingraff-evals/harnesses.json(pi -p --mode json). Opt-in A/B:Steal from Pi is TUI-first paint (this PR). Do not steal Pi's 4-tool catalog (ADR 0024 measured fail) or a welcome essay (ADR 0021).
Verify
zig build tui-test463/463- item/**bold**paints•and drops the markers