Skip to content

_pyrepl: switch console refresh to structured rendered screens #148105

@pablogsal

Description

@pablogsal

Bug report

The _pyrepl refresh path tangles screen generation, layout math, and terminal I/O together. Both Unix and Windows consoles independently reconstruct what changed from raw string lists, duplicating layout logic. Style metadata is discarded mid-pipeline, blocking richer theme support. A single dirty flag triggers full recomputation even when only an overlay or prompt changed. Completions are spliced into source content rather than layered on top, complicating cache invalidation. Prompt selection also breaks on wrapped lines because the cached rendered-row count is used where a logical line number is expected.

Additionally, because there is no line-level diffing, unchanged lines are fully redrawn every refresh cycle, causing visible flickering in terminals like Ghostty.

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errortype-refactorCode refactoring (with no changes in behavior)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions