Skip to content

chore(scripts): add a pty probe for debugging prompt renders - #96

Merged
plttn merged 1 commit into
mainfrom
push-txuxovrvzrwy
Jul 25, 2026
Merged

chore(scripts): add a pty probe for debugging prompt renders#96
plttn merged 1 commit into
mainfrom
push-txuxovrvzrwy

Conversation

@plttn

@plttn plttn commented Jul 25, 2026

Copy link
Copy Markdown
Owner

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 calling fish_prompt from 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; see scripts/prompt_probe/README.md for usage. A pointer to it is added in AGENTS.md.

Test plan

  • Step mode
  • --trace
  • --shell
  • --shell --trace
  • Live-edit resync check

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>
@plttn
plttn merged commit 7754d0d into main Jul 25, 2026
7 checks passed
@plttn
plttn deleted the push-txuxovrvzrwy branch July 25, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant