Skip to content

[Bug]: tap-to-open truncates URLs wrapped across lines  #5368

Closed

Description

@DEAD1nsane

Problem description

With terminal-onclick-url-open = true, tapping a URL longer than the terminal width only opens the first visual line. The tap detector matches per visual line and doesn't join wrapped lines, so the browser opens a truncated link.

Steps to reproduce the behavior.

  1. Set terminal-onclick-url-open = true, run termux-reload-settings.
  2. On a narrow terminal (~80 cols), print this URL on its own line:
https://www.google.com/search?q=termux+terminal+onclick+url+open+wrapped+long+url+tap+opens+only+first+line
  1. Tap the URL. Only the first visual line opens (truncated link).

What is the expected behavior?

Tap opens the full URL across the line wrap (join wrapped lines, or support OSC 8 hyperlinks).

System information

  • Termux application version: 0.119.0-beta.3 (com.termux)
  • Android OS version: 17
  • Device model: Pixel 10

Activity

  1. Soupboy006 commented on Oct 13, 2026

    @Soupboy006

    I reproduced the tap path on JVM (TerminalEmulator → getWordAtLocation → TermuxUrlUtils.extractUrls) with your exact URL on an 80-column screen. Result on current master: tapping either visual line already returns and extracts the full 107-char URL — the fresh-print case works, so I could not reproduce the truncation as stated.

    What I did find and reproduce: a wrapped word across the transcript boundary still truncates. If the head of the URL has scrolled into the transcript, tapping its visible tail returns only the on-screen part (27 chars in my repro — no URL detected at all). Root cause: the upward row expansion in TerminalBuffer.getWordAtLocation stops at screen row 0 (while (y1 > 0 ...)) and never looks into transcript rows, while the downward expansion has no such floor.

    PR #5378 fixes that (1 line + regression test), which covers the scrolled case of this issue.

    If you still see truncation with freshly printed output and no scrollback above, please share the exact bytes (e.g. does the line contain a real newline, wide chars, or trailing spaces?) and your columns/font size — there may be a second trigger I haven't found.

  2. changed the title [-][Bug]: tap-to-open truncates URLs wrapped across lines[/-] [+][Bug]: tap-to-open truncates URLs wrapped across lines [/+] on Oct 15, 2026
  3. DEAD1nsane commented on Oct 15, 2026

    @DEAD1nsane
    Author

    it works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions