grid: re-intern the pen on every sweep that compacts the style table #423
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!423
Loading…
Reference in a new issue
No description provided.
Delete branch "grid/gc-remaps-pen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #419
TableGc::maybe_sweeptook a bareScreenBufferand dropped thecompactedflag of its style sweep. The daemon's parse core sweptgrid.screen_mut()through it, so after a compactionGrid::pen_stylekept an id that now named another style or none at all: text printed next lost its truecolor colors, underline color and ISO protection until the program set its SGR again.Change
maybe_sweeptakes&mut impl Sweepable, a sealed trait implemented forGrid(sweeps throughGrid::gc_styles/gc_sizings, which re-intern the pen and remap the open sizing-run handle) and forScreenBuffer(the client shadow, which holds no handle outside its cells). The sweep methods take a token only felis-grid can construct.Grid::screen_mutis removed and theScreenBuffersweeps arepub(crate), so no driver outside felis-grid can sweep a grid's screen without its handles.pen_styleis the onlyStyleIdheld outside cells.SavedCursor(DECSC and the inactive screen's slot) storesAttributesand re-interns on restore;current_sizing_handleis remapped byGrid::gc_sizings.has_iso_protectedstays consistent:compactrecomputes it and the pen re-intern ORs the pen's flag back in.Tests
table_gc/tests.rs: text printed after a compactingmaybe_sweepkeeps the pen set before it (truecolor fg/bg, curly underline with its color, ISO protection honored by EL) on the primary and alternate screen, after DECSC before the sweep, and for the primary pen saved across?1049h; plus a proptest comparing a grid swept at random points against an unswept one over interleaved pen / print / sweep / DECSC / DECRC / alt-screen steps. The regression test and the proptest fail whenGridsweeps its screen bare.pool.rs: the daemon'sParseCore::maybe_gc_tablespath keepsRgb(0,16,0)on text printed after the sweep.just checkpasses locally.natsukium referenced this pull request2026-09-25 10:47:31 +09:00
natsukium referenced this pull request2026-09-25 11:02:19 +09:00