generated from erix/meta
[FEATURE] Count UTF-8 terminal scalars as native cells #4
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/lib-console#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem and motivation
The ordinary terminal currently advances once per UTF-8 byte. A multibyte character therefore occupies several fallback cells, making cursor geometry and narrow manual-page layout misleading.
Proposed behavior and scope
Frame well-formed UTF-8 scalars across fragmented ordinary terminal writes. Each non-ASCII scalar uses one existing fallback glyph and one native cell. Keep the current ASCII font lookup; full Unicode glyph selection, shaping and wide-cell behavior remain separate work. Apply identical rules to framebuffer rendering and geometry-only tracking.
Authority, security and reliability
The decoder stores only bounded framing state. It creates no framebuffer or endpoint authority. Decode only ordinary ground text; non-ASCII bytes inside CSI remain invalid. Malformed prefixes cannot swallow ASCII controls or synthesize controls from encoded bytes. Writer/trusted boundaries discard incomplete framing. Literal log rendering keeps its existing behavior.
Acceptance criteria
Alternatives and tradeoffs
Counting bytes preserves the old fallback output but prevents useful scalar-aligned pagination. This bounded framing change improves the existing fixed-cell renderer without introducing a font engine or allocation.
Tracking and rollout
Coordinate LibConsole PR2, manual geometry and Phase 6. The original implementation follows RFC 3629.
e8faed60 frames ordinary UTF-8 text across fragmented writes. Each complete non-ASCII scalar uses one fallback cell; rendering and cursor tracking share the same actions. Malformed prefixes preserve ASCII recovery, CSI refusal stays intact, and writer suspension discards partial text. The physical manual pager now has this dependency; broader font and shaping work remains separate.