Skip to content

Fix BEL-terminated OSC 8 hyperlink widths - #462

Open
GreedyC wants to merge 1 commit into
astanin:masterfrom
GreedyC:codex/fix-bel-hyperlinks
Open

GreedyC wants to merge 1 commit into
astanin:masterfrom
GreedyC:codex/fix-bel-hyperlinks

Conversation

@GreedyC

@GreedyC GreedyC commented Oct 2, 2026

Copy link
Copy Markdown

BEL-terminated OSC 8 hyperlinks were counted as visible text, which widened table columns. Accept BEL alongside ST in the hyperlink pattern, without changing its capture groups or the displayed output. Use a bytes replacement when stripping controls from bytes inputs, so recognized hyperlinks do not raise TypeError.

Add 25 regression cases covering ST/BEL and mixed terminators, string and bytes cells, linked headers, both width modes, link IDs, semicolons in URLs, and adjacent links. Document the accepted terminators in the README.

Fixes #460. This is limited to terminator handling; the independent-sequence and wrapping changes in #443 are separate.

Validation on macOS arm64:

  • The final regression tests give 22 failures and 3 passes with the original upstream source, and all 25 pass with this patch.
  • Full suite including doctests, NumPy, Pandas and wcwidth: 407 passed, 1 skipped on Python 3.10.20 and 3.12.13. Python 3.12 branch coverage is 93% overall.
  • All repository pre-commit hooks, Ruff 0.15.4 lint/format and git diff --check pass.
  • Source distribution and wheel builds pass. The checkout is shallow, so the generated development version is not release metadata.

Other operating systems and the full upstream Python matrix have not been run locally.

Prepared with Codex assistance.

Assisted-by: OpenAI Codex <noreply@openai.com>
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