Repository navigation
Conversation
why: Callers migrating from pyte.Screen.display and HistoryScreen need full-width rectangular row export and stateless scrollback paging over immutable snapshots without mutating live terminal state. what: - Add RowView.display_text and display_lines on RegionView, Screen, Snapshot, and Terminal with wide-glyph boundary clipping - Add Snapshot.viewport(offset=0) returning a clamped (rows, cols) RegionView over retained primary history without alt-screen blending - Expand docs/topics/migrating-from-pyte.md with a pyte 0.8.2 matrix, documented omissions, and runnable doctests
4 tasks done
This branch was successfully deployed
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.
Closes #59 (depends on #61)
Summary
RowView.display_textanddisplay_linesfor column-padded rectangular screen export.Snapshot.viewport(offset=0)for stateless row-offset scrollback paging over immutable snapshots.docs/topics/migrating-from-pyte.mdwith apyte0.8.2compatibility matrix and doctests.Changes
Screen and snapshot views
src/libvt/screen.py: addRowView.display_textandRegionView.display_lines/Screen.display_lines, padding trailing blanks to exact slice width in terminal columns while replacing wide leads or trailing spacers clipped at slice edges with" ".src/libvt/terminal.py: addSnapshot.display_lines,Terminal.display_lines, andSnapshot.viewport(offset=0)returning an immutable(rows, cols)RegionViewclamped tolen(history)on primary snapshots (thawing historicalFrozenRowentries whose width differs fromSnapshot.cols), pinned to the active viewport on alternate-screen snapshots, and raisingValueErroron negativeoffsetorTypeErroronbool.Tests and documentation
tests/test_pyte_compat.py: cover wide-character, ZWJ emoji, and combining-markdisplay_lines, sub-slice clipping, primary and alternateSnapshot.viewport()paging, snapshot immutability across subsequentfeed()calls, and chunked-stream parity.docs/topics/migrating-from-pyte.mdandCHANGES: documentpyte(0.8.2baseline) API mappings, intentional omissions, and runnable migration doctests.Design decisions
Snapshot.viewport(offset=0)primitive rather than a statefulHistoryScreencursor onTerminalso history inspection cannot mutate live terminal rows or contend with concurrentfeed()calls.Snapshot.viewport(offset)isolated to the alternate viewport rather than blending primary scrollback above full-screen TUI buffers.Test plan
display_linespadding and wide-boundary clipping across CJK, ZWJ emoji, and combining marks intests/test_pyte_compat.pySnapshot.viewport()clamping, negative/bool rejection, alt-screen isolation, and post-feed immutability intests/test_pyte_compat.pydocs/topics/migrating-from-pyte.mddoctests viapytestand verify cross-references viajust build-docsruff format,ruff check,ty check,pytest, andjust build-docs