You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pi lays out visible tabs as three columns, but previously emitted the raw TAB byte. The terminal then expanded it to the next physical tab stop, which could auto-wrap a logically single-row overlay and desynchronize subsequent physical row updates.
This change expands visible tabs to three spaces in normalizeTerminalOutput(), after layout and overlay composition but before terminal output. Logical component/editor content remains unchanged, and recognized terminal control sequences remain byte-identical.
Tests
Added an xterm-backed TUI regression that verifies:
a tab-containing overlay remains on one physical terminal row;
following rows remain aligned;
raw visible TAB bytes do not reach terminal output;
While reviewing the fix, I noticed two possible follow-ups and intentionally kept both out of #6697:
Pi's fixed tab width is currently duplicated as 3 / " " in graphemeWidth(), truncateFragmentToWidth(), visibleWidth(), and normalizeTerminalOutput(). Would a small follow-up PR introducing
internal TAB_WIDTH / TAB_EXPANSION constants be useful, or would you prefer to leave this as-is?
extractAnsiCode() currently recognizes CSI sequences only when they end in one of [mGKHJ], while ECMA-48 defines the CSI final-byte range as 0x40–0x7E. This would be a broader behavioral change
affecting all parser callers, so I did not include it here. I also do not yet have a valid user-facing reproduction using a standards-compliant CSI sequence.
Would you prefer a separate issue/PR for either of these, or should I leave them alone until there is a concrete bug report?
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
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.
Summary
Fixes #6696.
Pi lays out visible tabs as three columns, but previously emitted the raw TAB byte. The terminal then expanded it to the next physical tab stop, which could auto-wrap a logically single-row overlay and desynchronize subsequent physical row updates.
This change expands visible tabs to three spaces in
normalizeTerminalOutput(), after layout and overlay composition but before terminal output. Logical component/editor content remains unchanged, and recognized terminal control sequences remain byte-identical.Tests
Added an xterm-backed TUI regression that verifies: