Repository navigation
Fix BEL-terminated OSC 8 hyperlinks inflating column widths - #475
Open
thejedi433 wants to merge 1 commit into
Open
thejedi433 wants to merge 1 commit into
thejedi433 wants to merge 1 commit into
Conversation
) _st only recognized ESC \ as the OSC string terminator, so hyperlinks terminated with BEL (0x07, explicitly allowed by the OSC 8 spec) did not match the ANSI escape pattern and their full escape payload was counted as visible text when computing column widths. Accept both terminators: _st = (?:ESC \|BEL). Adds regression test test_alignment_of_bel_terminated_links; full suite: 324 passed.
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.
BEL (0x07) is an alternative valid OSC string terminator per the OSC 8 spec, but
_stonly recognizedESC \\. Hyperlinks terminated with BEL therefore failed to match the ANSI escape pattern and their full escape payload counted as visible text in column-width calculations.Fix: accept both terminators —
_st = (?:ESC \\\|BEL).Closes #460
Verified with the reproduction from the issue: both terminators now render identical 8-char first columns (
+--------+---------+). Regression testtest_alignment_of_bel_terminated_linksadded (fails without the fix, passes with it). Full suite: 324 passed, 60 skipped (Python 3.12, uv).