Repository navigation
fix(rig): render orphaned pyte wide-char stubs as blanks (#160) - #163
Merged
Merged
Conversation
pyte 0.8.2's display IndexErrors on its own transient state: a stub cell (data="") orphaned when one pty chunk overwrites a wide glyph's lead and the next hasn't rewritten the stub yet. The rig's poller can land in that window mid-redraw — clustered on the image scenarios' rewritten 📎 rows, and Python-version-independent (no combining marks in the stream; widths come from the pinned wcwidth tables). RigScreen renders the orphan as the blank a real terminal shows; the venv setup line now pins pyte/wcwidth/pillow exactly. ADR 0033 records why the pyte bump (no release exists) and the 3.13 pin (wrong cause) were rejected.
terenceponce
force-pushed
the
fix/rig-pyte-python
branch
from
November 1, 2026 17:30
5191039 to
27c7c5a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…aster frame-shift claim, state the deliberate-diff removal
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.
Fixes #160
What
The capture rig's pyte screen no longer crashes on pyte's own transient
state. pyte 0.8.2 writes a
data=""stub cell after every wide (2-cell)glyph; when one pty chunk overwrites a wide glyph's lead cell with a
narrow one and the next chunk hasn't yet rewritten the stub, the stub is
orphaned — and
Screen.display'swcwidth(char[0])raisesIndexErroron the empty string if the poller reads in that window.The rig polls
displayconstantly outside the feed lock(
wait_for/text()/footer_span/...), so it can always land theremid-redraw.
RigScreen(pyte.Screen)(both construction sites: live + GIF replay)renders the orphan as the blank a real terminal shows for the leftover
continuation cell; every non-orphaned state renders byte-identically to
stock pyte 0.8.2 (verified against
pyte.Screenon narrow, wide, andend-of-row-wrap content). The venv setup line in the docstring now pins
pyte==0.8.2 wcwidth==0.9.4 pillow==13.0.0so a fresh checkout + rigsetup gets the exact versions every lane ran on.
Non-visual change: rig/test infrastructure only — no product surface, no capture content change beyond un-crashing.
Root cause is a pyte race, not Python 3.14
The #143 lane's attribution to the interpreter doesn't hold:
(attach still, attach gif, drop-image gif) passed three consecutive
pre-fix runs on Python 3.14.8 + pyte 0.8.2 in the unmodified worktree.
unicodedata(combining classification, NFC) — the app's byte stream contains no
combining marks, so the interpreter version cannot change what pyte
parses or renders. Widths come from the
wcwidthpackage's fixedpure-Python tables.
(📎 = 2, CJK = 2, ❯ = 1) — no layout disagreement either.
the only content both wide and dynamically rewritten next to narrow
text; CJK scenarios type wide text append-only and never orphan.
Disposition (ADR 0034)
fix exists only on unreleased master, which also changed rendering
semantics (grapheme clusters, per-cluster
wcswidth) enough to shiftthe rig's asserted frames; a git-commit pin would make the venv
fragile.
does not cause; the race exists on every Python and would recur under
load.
Python, and disappears into upstream's own fix whenever a pyte
release lands (master's
wcswidth(char)already survives emptystubs).
Evidence
Full-menu smoke on Python 3.14.8 / pyte 0.8.2 / wcwidth 0.9.4 /
pillow 13.0.0 — all 35 argparse scenario choices in primary mode (28
still, 7 gif-native) plus 6 documented secondary variants = 41/41:
mix ciexit 0 — 1836 tests passed, coverage 99.2%.byte-identical to stock
pyte.Screen.