Skip to content

Fix BEL-terminated OSC 8 hyperlinks inflating column widths - #475

Open
thejedi433 wants to merge 1 commit into
astanin:masterfrom
thejedi433:fix/bel-osc8-hyperlink-width
Open

thejedi433 wants to merge 1 commit into
astanin:masterfrom
thejedi433:fix/bel-osc8-hyperlink-width

Conversation

@thejedi433

Copy link
Copy Markdown

BEL (0x07) is an alternative valid OSC string terminator per the OSC 8 spec, but _st only recognized ESC \\. 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 test test_alignment_of_bel_terminated_links added (fails without the fix, passes with it). Full suite: 324 passed, 60 skipped (Python 3.12, uv).

)

_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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BEL-terminated OSC 8 hyperlinks inflate table column widths

1 participant