[PR #16775] Fix the hyperlink detection when there are leading wide glyph in the row #30992

Open
opened 2026-01-31 09:44:25 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/16775

State: closed
Merged: Yes


Summary of the Pull Request

URL detection was broken again in #15858. When the regex matched, we calculate the column(cell) by its offset, we use forward or backward iteration of the column to find the correct column that displays the glyphs of _chars[offset].

abf5d9423a/src/buffer/out/Row.cpp (L95-L104)

However, when calculating the currentOffset we forget that MSB of _charOffsets[col] could be 1, or col is pointing to another glyph in preceding column.

abf5d9423a/src/buffer/out/Row.hpp (L223-L226)

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16775 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request URL detection was broken again in #15858. When the regex matched, we calculate the column(cell) by its offset, we use forward or backward iteration of the column to find the correct column that displays the glyphs of `_chars[offset]`. https://github.com/microsoft/terminal/blob/abf5d9423a23b13e9af4c19ca35858f9aaf0a63f/src/buffer/out/Row.cpp#L95-L104 However, when calculating the `currentOffset` we forget that MSB of `_charOffsets[col]` could be `1`, or col is pointing to another glyph in preceding column. https://github.com/microsoft/terminal/blob/abf5d9423a23b13e9af4c19ca35858f9aaf0a63f/src/buffer/out/Row.hpp#L223-L226
claunia added the pull-request label 2026-01-31 09:44:25 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30992