Repository navigation
Conversation
rsbin1178
force-pushed
the
fix/inline-multiscreen-println
branch
from
October 3, 2026 03:37
6715092 to
38f887e
Compare
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.
CONTRIBUTING.md.The Discussion item is not applicable: this is a bug fix for #1822, not a new feature.
Summary
Fixes #1822.
A single multi-screen
Printlncan remove an already-painted, unchanged inline View. The printed rows remain complete and ordered, but the managed View disappears and its cursor is left at the end of the printed block.This change:
No public API changes are introduced. Program-level propagation of insertion errors is intentionally outside this focused fix;
tea.gois unchanged. Renderer-level write and short-write checks are retained.Relationship to existing work
Related: #1741 and #1766.
Those proposals concern pending-View synchronization and printing before the initial flush. The regression here explicitly flushes an unchanged View before printing, uses fixed geometry, and inserts 80 short ASCII rows in one call. It does not rely on resize, model switching, streaming, or raw terminal clearing.
The synchronization changes overlap those proposals because frame geometry and final restoration must remain consistent throughout insertion. This PR acknowledges that overlap and can be coordinated with those changes; it does not claim those reports are unrelated.
Regression coverage
TestCursedRenderer_insertAboveMultiScreenverifies that the initial View is actually visible, then checks the terminal screen, cursor, shell history, and all ordered/unique output rows immediately after insertion, before another render or cleanup.The test fails on unmodified production sources at
ff51ba4c51f85875761b15a64f9ab9aa0eaa9fa1and passes with this patch. Additional cases cover pending/shrunken/empty/full-height/oversized frames, subsequent Views and insertions, hidden cursors, ANSI/wide/exact-margin text, alternate screen, and writer failures.A test-only
x/vtdependency supplies terminal-state assertions rather than relying only on escape-stream substrings. Upstream's Go 1.26.0 minimum and production dependency versions are unchanged. The examples checksum updates keep its module tidy.Validation
Executed locally on macOS arm64:
go test -race -count 4 -cpu 1,4 ./....go vet ./..., root/examples builds and tests, and tidy/idempotence checks.An independent public-API repro was also run in a 40x10 controlling PTY on macOS 26.5.1 arm64 with Go 1.26.6 and pyte 0.8.2. Four captures each with and without
NO_COLORconfirmed that the base loses its controls/cursor while the candidate preserves them, all 80 rows, and shell history. Snapshots are taken after print completion and before repair input or Quit. Terminal modes are restored afterProgram.Runreturns.Windows/amd64 and Linux/amd64 test binaries were cross-compiled, not executed. Remote GitHub CI and broader GUI-terminal coverage are not claimed by these local results.