chore(scripts): add a pty probe for debugging prompt renders - #96
Merged
Conversation
Timing bugs in the render path cannot be seen by calling fish_prompt from a script: the bug is in when fish renders, not in what one render prints. This drives a real interactive fish in a pty, with an isolated HOME built from the working copy, and takes steps for typing, pasting several lines at once, waiting, and resizing the window either with or without letting fish notice. --trace rewrites the prompt in that copy to log every render, dispatch and signal handler run, which is how the two staleness bugs behind the last three commits were found. It matches exact lines and exits with the anchor it wanted when they move, so it cannot quietly log nothing. The README covers what to run and how to read the log. Manual tool only; mise and CI do not touch it. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
Adds
scripts/prompt_probe/probe.py, a manual tool that drives a real interactive fish shell in a pty (isolated HOME, keystrokes, window resizes) and logs every render, dispatch, and signal-handler run. Timing bugs in the async render path — a stale prompt, a missed repaint, two renders racing — can't be seen by callingfish_promptfrom a script, since the bug is in when fish renders rather than what one render prints. This tool was used to find and confirm the fix in #94.Not part of
mise run test; seescripts/prompt_probe/README.mdfor usage. A pointer to it is added inAGENTS.md.Test plan
--trace--shell--shell --trace