Skip to content

Links wrapped across lines not clickable in Kitty terminal #35649

Closed as not planned

Description

@sporteka2

Links wrapped across lines not clickable in Kitty terminal (OSC 8 hyperlinks? / markdown rendering)

opencode version: 1.17.13
Terminal: Kitty 0.32.2
OS: Linux Mint 22.3 Cinnamon, X11

Description

When opencode outputs a long URL that wraps to the next line in the Kitty terminal, the link is not clickable. Only the part on the first line is recognized as a link. This does NOT happen with regular terminal output — Kitty handles wrapped URLs correctly in normal shell output (e.g., echo "https://very.long.url/...").

This suggests opencode's terminal output is interfering with Kitty's URL detection across line wraps. Possible causes:

  1. OSC 8 hyperlinks — Opencode may use terminal hyperlinks (\e]8;;url\e\\text\e]8;;\e\\) and the hyperlink span doesn't extend across wrapped lines, breaking Kitty's native URL detection
  2. Invisible characters — Some markdown rendering artifacts (zero-width spaces, ANSI codes, etc.) between the wrapped parts of the link prevent Kitty from joining them
  3. Markdown link rendering — The way opencode renders [text](url) in the terminal might split the URL or pad it in a way that breaks wrapping

Steps to reproduce

  1. Run opencode in Kitty terminal
  2. Ask it to output a long URL (e.g., a raw GitHub link like raw.githubusercontent.com/...)
  3. Resize the terminal so the URL wraps to the next line
  4. Try to Ctrl+Click on the link — only the first-line portion works
  5. Compare with echo "same-long-url" in the same terminal — Kitty correctly detects the wrapped URL

Expected behavior

Long URLs output by opencode should be clickable even when they wrap across lines, consistent with normal terminal behavior.

Additional info

  • Works fine in other terminals (tested: GNOME Terminal)
  • In Kitty, regular shell output handles wrapped links correctly — the issue is specific to opencode's output

Activity

  1. sporteka2 commented on Jul 7, 2026

    @sporteka2
    Author

    Related: #18394 (long URLs in markdown tables)

  2. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. sporteka2 commented on Jul 10, 2026

    @sporteka2
    Author

    I checked #18394 and there is an important difference:

    • Long URLs in markdown tables are split across lines and become unclickable #18394 is about URLs in markdown tables being split because the table column is too narrow. The URL is rendered as a single piece of output, but opencode's markdown table formatter splits it across cell lines. This is a markdown rendering issue.

    • Links wrapped across lines not clickable in Kitty terminal #35649 (this issue) is about long URLs in general terminal output (not inside tables) wrapping because the terminal window is too narrow. In Kitty (and possibly other terminals), when a long line is wrapped by the terminal emulator at the window edge, OSC 8 hyperlinks break. The URL is correct in opencode's output, but Kitty's soft line wrapping breaks the hyperlink.

    They are related (both result in broken links due to line wrapping), but the root causes differ — one is opencode's markdown table renderer, the other is terminal-level line wrapping in Kitty. If a maintainer thinks they should be consolidated under one umbrella issue, that is fine, but the fix for one may not fix the other.

  4. ruinivist commented on Aug 8, 2026

    @ruinivist

    +1
    I see the same in Konsole too and seems to be opentui related ( repro )

    example, full link is recognized in Konsole
    Image

    but not when rendered via opentui

    Image
  5. lucidash commented on Aug 26, 2026

    @lucidash

    Hi @simonklee, sorry to bother — just checking in on this one since it's still reproducible on the latest release (1.18.23), and there are additional reports from Konsole and Zed users in the thread.

    While looking into it, I found some related work that appears to have stalled:

    • Upstream: anomalyco/opentui#736 already merged the renderer-side fix — it adds the id parameter to OSC 8 sequences so wrapped segments are grouped as a single link, and exports a detectLinks() helper.
    • Downstream: the wiring PRs that connect detectLinks to the TUI markdown rendering path (#20400, #21559) seem to have been closed by automated PR cleanup without being merged.

    Is making wrapped links clickable across lines still planned for this issue? If a refreshed PR building on the merged upstream work would be welcome, I'd be glad to help with that. And if this is already being handled internally, please feel free to just close this question. Thanks for your time!

  6. simonklee commented on Aug 26, 2026

    @simonklee
    Member

    Hi @simonklee, sorry to bother — just checking in on this one since it's still reproducible on the latest release (1.18.23), and there are additional reports from Konsole and Zed users in the thread.

    While looking into it, I found some related work that appears to have stalled:

    • Upstream: anomalyco/opentui#736 already merged the renderer-side fix — it adds the id parameter to OSC 8 sequences so wrapped segments are grouped as a single link, and exports a detectLinks() helper.
    • Downstream: the wiring PRs that connect detectLinks to the TUI markdown rendering path (#20400, #21559) seem to have been closed by automated PR cleanup without being merged.

    Is making wrapped links clickable across lines still planned for this issue? If a refreshed PR building on the merged upstream work would be welcome, I'd be glad to help with that. And if this is already being handled internally, please feel free to just close this question. Thanks for your time!

    This is very much on the docket. anomalyco/opentui#1439

  7. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

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