Repository navigation
Join transcript rows in getWordAtLocation for wrapped words (#5368) - #5378
Open
Soupboy006 wants to merge 1 commit into
Open
Soupboy006 wants to merge 1 commit into
Soupboy006 wants to merge 1 commit into
Conversation
Tapping the visible tail of a word wrapped across the transcript boundary returned only the on-screen part, so tap-to-open saw a truncated URL. The upward row expansion stopped at screen row 0 and never looked into transcript rows. Allow it to expand down to -activeTranscriptRows (getSelectedText already clamps and supports negative rows). Adds a regression test tapping both ends of a URL wrapped over the transcript/screen boundary.
Soupboy006
force-pushed
the
fix/word-at-location-transcript-5368
branch
from
October 13, 2026 11:16
a6d7742 to
c2ead99
Compare
|
gh pr checkout 5378 |
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.
Related to #5368 (tap-to-open truncates wrapped URLs).
What I verified first
I reproduced the tap path on JVM (
TerminalEmulator+getWordAtLocation+TermuxUrlUtils.extractUrls): with the exact URL from #5368 printed fresh on an 80-column screen, tapping either visual line already returns and extracts the full URL on current master — the no-scroll case works.The remaining truncation
What still truncates: a word wrapped across the transcript/screen boundary. If the head of a wrapped URL has scrolled into the transcript, tapping its visible tail returns only the on-screen part:
getWordAtLocationexpands the tapped row upward withwhile (y1 > 0 ...), which stops at screen row 0 and never looks at transcript rows (negative external rows), even thoughgetSelectedTextfully supports them. The downward expansion has no such floor.extractUrlsfound no URL at all.Fix (1 line,
TerminalBuffer.getWordAtLocation)Allow the upward expansion to reach
-getActiveTranscriptRows(). The loop still strictly decreases andgetSelectedTextclamps out-of-range rows, so it always terminates. When there is no transcript the bound equals the oldy1 > 0check exactly, so on-screen behavior is unchanged.Test
New
testGetWordAtLocationAcrossTranscriptBoundaryinScreenBufferTesttaps both ends of a URL wrapped over the boundary and asserts the full word both times (fails before, passes after — verified by executing the same scenario against the emulator).Fixes the scrolled case of #5368.