Skip to content

fix(tui): add OSC 8 hyperlinks for wrapped URLs - #17814

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
Phineas1500:fix/osc8-hyperlinks
Feb 23, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
Phineas1500:fix/osc8-hyperlinks

Conversation

@Phineas1500

@Phineas1500 Phineas1500 commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #17772 — an alternative to #17777 that uses OSC 8 terminal hyperlinks instead of ZWNJ characters.

  • Post-processes rendered markdown output to wrap URL fragments with OSC 8 hyperlink sequences, making them clickable even when broken across lines by pi-tui's word wrapping
  • Each line fragment of a broken URL gets its own OSC 8 sequence pointing to the full URL
  • Gracefully degrades on terminals without OSC 8 support (iTerm2, Windows Terminal, GNOME Terminal 3.50+, Kitty, WezTerm all support it)

Why this over #17777 (ZWNJ approach)

#17777 (ZWNJ) This PR (OSC 8)
Copy/paste Broken — invisible U+200C chars corrupt pasted URLs Clean — URL text is untouched
Clickable links No — only hints where to break lines Yes — each fragment is a real terminal hyperlink
Works with pi-tui No — breakLongWord() still breaks char-by-char regardless of ZWNJ Yes — post-processes after wrapping
Unicode correctness U+200C has line-break class CM, not WJ; doesn't actually prevent breaks N/A — accepts wrapping, makes fragments clickable
Degradation Invisible chars always present in text Terminals without OSC 8 simply ignore sequences

The ZWNJ approach tries to prevent wrapping but fails because breakLongWord() ignores ZWNJ. Our approach accepts wrapping and makes the broken fragments clickable using the industry-standard OSC 8 mechanism.

Changes

  • src/tui/osc8-hyperlinks.ts — extractUrls() to find URLs in markdown source, addOsc8Hyperlinks() to post-process rendered lines with OSC 8 sequences (handles multi-line URL splits)
  • src/tui/components/hyperlink-markdown.ts — HyperlinkMarkdown wrapper around pi-tui's Markdown that applies OSC 8 post-processing in render()
  • src/tui/components/assistant-message.ts — Use HyperlinkMarkdown instead of Markdown
  • src/tui/osc8-hyperlinks.test.ts — 17 unit tests

Test plan

  • pnpm vitest run src/tui/osc8-hyperlinks.test.ts — 17/17 pass
  • pnpm build passes
  • pnpm check passes (lint + format + types)
  • Manual: TUI renders long URLs as clickable OSC 8 hyperlinks in iTerm2
  • Manual: verify graceful degradation in a terminal without OSC 8 support

Greptile Summary

Adds OSC 8 terminal hyperlinks to make long URLs clickable when wrapped across multiple lines in the TUI. Post-processes rendered markdown to wrap URL fragments with hyperlink sequences.

  • New osc8-hyperlinks.ts module extracts URLs from markdown and adds OSC 8 sequences to rendered lines
  • HyperlinkMarkdown component wraps pi-tui's Markdown to apply hyperlink processing
  • AssistantMessageComponent now uses HyperlinkMarkdown instead of plain Markdown
  • Handles URLs broken across lines by tracking pending fragments and resolving them against known URLs
  • Comprehensive test coverage (17 tests) for URL extraction, ANSI handling, and multi-line wrapping

Confidence Score: 4/5

  • Safe to merge with minor improvements needed for edge cases
  • Strong implementation with comprehensive tests and well-structured code. Two issues already identified in previous review threads need addressing (regex quantifier mismatch and prefix resolution logic), but these are edge cases that don't affect common usage. The feature is opt-in (only applied to assistant messages) and degrades gracefully on terminals without OSC 8 support.
  • Pay attention to src/tui/osc8-hyperlinks.ts - ensure the two previously-identified issues are resolved before merging

Last reviewed commit: ac29c75

Copilot AI review requested due to automatic review settings February 16, 2026 06:20

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/tui/osc8-hyperlinks.ts Outdated
}

// Find new URL starts in visible text
const urlRe = /https?:\/\/[^\s)\]>]*/g;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex quantifier mismatch: * should be +

The regex here uses * (zero or more) after ://, while extractUrls on line 30 uses + (one or more). With *, this regex can match a bare "https://" with no host or path, which would then be incorrectly resolved to whichever known URL happens to appear first in the array. This could produce spurious hyperlinks on text like "Use https:// for secure connections".

Suggested change
const urlRe = /https?:\/\/[^\s)\]>]*/g;
const urlRe = /https?:\/\/[^\s)\]>]+/g;
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tui/osc8-hyperlinks.ts
Line: 91:91

Comment:
**Regex quantifier mismatch: `*` should be `+`**

The regex here uses `*` (zero or more) after `://`, while `extractUrls` on line 30 uses `+` (one or more). With `*`, this regex can match a bare `"https://"` with no host or path, which would then be incorrectly resolved to whichever known URL happens to appear first in the array. This could produce spurious hyperlinks on text like `"Use https:// for secure connections"`.

```suggestion
  const urlRe = /https?:\/\/[^\s)\]>]+/g;
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +119 to +126
if (!found) {
for (const known of knownUrls) {
if (fragment.startsWith(known)) {
resolvedUrl = known;
break;
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix resolution picks first match, not longest

When a fragment is a superstring of multiple known URLs (e.g., knownUrls contains both https://example.com and https://example.com/api/v2, and the fragment is https://example.com/api/v2/users), this loop resolves to whichever known URL appears first in the array rather than the most specific (longest) match. Consider selecting the longest matching prefix instead:

Suggested change
if (!found) {
for (const known of knownUrls) {
if (fragment.startsWith(known)) {
resolvedUrl = known;
break;
}
}
}
if (!found) {
let bestLen = 0;
for (const known of knownUrls) {
if (fragment.startsWith(known) && known.length > bestLen) {
resolvedUrl = known;
bestLen = known.length;
}
}
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tui/osc8-hyperlinks.ts
Line: 119:126

Comment:
**Prefix resolution picks first match, not longest**

When a fragment is a superstring of multiple known URLs (e.g., `knownUrls` contains both `https://example.com` and `https://example.com/api/v2`, and the fragment is `https://example.com/api/v2/users`), this loop resolves to whichever known URL appears first in the array rather than the most specific (longest) match. Consider selecting the longest matching prefix instead:

```suggestion
    if (!found) {
      let bestLen = 0;
      for (const known of knownUrls) {
        if (fragment.startsWith(known) && known.length > bestLen) {
          resolvedUrl = known;
          bestLen = known.length;
        }
      }
    }
```

How can I resolve this? If you propose a fix, please make it concise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OSC 8 terminal hyperlink support to the TUI markdown renderer so URLs remain clickable even when pi-tui wraps them across lines.

Changes:

  • Introduces URL extraction + OSC 8 post-processing to hyperlink wrapped URL fragments
  • Wraps pi-tui Markdown with a new HyperlinkMarkdown component and updates assistant message rendering
  • Adds Vitest unit coverage for the new hyperlink behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
src/tui/osc8-hyperlinks.ts Implements URL extraction and OSC 8 hyperlink injection over rendered/wrapped lines
src/tui/osc8-hyperlinks.test.ts Adds unit tests for URL extraction and hyperlink insertion (including wrapped URLs)
src/tui/components/hyperlink-markdown.ts Adds a wrapper component that applies OSC 8 post-processing during render
src/tui/components/assistant-message.ts Switches assistant message body from Markdown to HyperlinkMarkdown

Comment thread src/tui/osc8-hyperlinks.ts Outdated
}

// Find new URL starts in visible text
const urlRe = /https?:\/\/[^\s)\]>]*/g;

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex allows zero characters after https:// because of *, so it can match and hyperlink a bare scheme like https:// (no host/path). Consider requiring at least one character after the scheme (e.g., use +) or adding a minimal host check to avoid producing hyperlinks for invalid/partial URLs.

Suggested change
const urlRe = /https?:\/\/[^\s)\]>]*/g;
const urlRe = /https?:\/\/[^\s)\]>]+/g;

Copilot uses AI. Check for mistakes.
Comment thread src/tui/osc8-hyperlinks.ts Outdated
Comment on lines +21 to +29
// Markdown link hrefs: [text](url)
const mdLinkRe = /\[(?:[^\]]*)\]\((https?:\/\/[^)]+)\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
urls.add(m[1]);
}

// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(/\[(?:[^\]]*)\]\([^)]+\)/g, "");

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown links can legally include a title after the URL (e.g., [text](https://ex.com \"title\")) and/or wrap the URL in angle brackets; with the current regex, mdLinkRe will capture the title as part of the URL, and stripped will remove patterns that don’t match real link boundaries (e.g., URLs containing )), causing incorrect URL resolution later. Consider parsing the markdown link destination more precisely (stop at whitespace before an optional title, support <...>, and avoid naive [^)]+), or leverage an existing markdown parser/tokenizer if available in this codebase.

Suggested change
// Markdown link hrefs: [text](url)
const mdLinkRe = /\[(?:[^\]]*)\]\((https?:\/\/[^)]+)\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
urls.add(m[1]);
}
// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(/\[(?:[^\]]*)\]\([^)]+\)/g, "");
// Markdown link hrefs: [text](url) or [text](<url> "title")
const mdLinkRe =
/\[(?:[^\]]*)\]\(\s*(<https?:\/\/[^>\s]+>|https?:\/\/[^\s)]+)[^)]*\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
let dest = m[1];
if (dest.startsWith("<") && dest.endsWith(">")) {
dest = dest.slice(1, -1);
}
urls.add(dest);
}
// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(
/\[(?:[^\]]*)\]\(\s*(?:<https?:\/\/[^>\s]+>|https?:\/\/[^\s)]+)[^)]*\)/g,
"",
);

Copilot uses AI. Check for mistakes.
Comment thread src/tui/osc8-hyperlinks.ts Outdated
Comment on lines +21 to +29
// Markdown link hrefs: [text](url)
const mdLinkRe = /\[(?:[^\]]*)\]\((https?:\/\/[^)]+)\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
urls.add(m[1]);
}

// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(/\[(?:[^\]]*)\]\([^)]+\)/g, "");

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown links can legally include a title after the URL (e.g., [text](https://ex.com \"title\")) and/or wrap the URL in angle brackets; with the current regex, mdLinkRe will capture the title as part of the URL, and stripped will remove patterns that don’t match real link boundaries (e.g., URLs containing )), causing incorrect URL resolution later. Consider parsing the markdown link destination more precisely (stop at whitespace before an optional title, support <...>, and avoid naive [^)]+), or leverage an existing markdown parser/tokenizer if available in this codebase.

Suggested change
// Markdown link hrefs: [text](url)
const mdLinkRe = /\[(?:[^\]]*)\]\((https?:\/\/[^)]+)\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
urls.add(m[1]);
}
// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(/\[(?:[^\]]*)\]\([^)]+\)/g, "");
// Markdown link hrefs: [text](url), with optional title and optional <...> dest
// Examples:
// [text](https://ex.com)
// [text](https://ex.com "title")
// [text](<https://ex.com>)
// [text](<https://ex.com> "title")
const mdLinkRe =
/\[(?:[^\]]*)\]\(\s*(?:<([^>\s]+)>|([^\s)]+))(?:\s+["'(][^)]*)?\s*\)/g;
let m: RegExpExecArray | null;
while ((m = mdLinkRe.exec(markdown)) !== null) {
const url = m[1] ?? m[2];
if (url) {
urls.add(url);
}
}
// Bare URLs (remove markdown links first to avoid double-matching)
const stripped = markdown.replace(mdLinkRe, "");

Copilot uses AI. Check for mistakes.
Comment thread src/tui/osc8-hyperlinks.ts Outdated
}

// Find new URL starts in visible text
const urlRe = /https?:\/\/[^\s)\]>]*/g;

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the URL matcher allows trailing punctuation (e.g., https://foo.com,), the fragment.startsWith(known) fallback will resolve the target to the clean known URL while still hyperlinking the punctuated fragment range. This makes the visible hyperlink text include punctuation (and can interfere with split detection/pending matching), even though the link target is different. Consider trimming common trailing punctuation from matched fragments before range creation (or using a stricter URL terminator set) so the hyperlinked visible span matches the resolved target more closely.

Copilot uses AI. Check for mistakes.
Comment on lines +99 to +101
// Resolve fragment to a known URL (exact > prefix > superstring)
let resolvedUrl = fragment;
let found = false;

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the URL matcher allows trailing punctuation (e.g., https://foo.com,), the fragment.startsWith(known) fallback will resolve the target to the clean known URL while still hyperlinking the punctuated fragment range. This makes the visible hyperlink text include punctuation (and can interfere with split detection/pending matching), even though the link target is different. Consider trimming common trailing punctuation from matched fragments before range creation (or using a stricter URL terminator set) so the hyperlinked visible span matches the resolved target more closely.

Copilot uses AI. Check for mistakes.
Comment on lines +120 to +125
for (const known of knownUrls) {
if (fragment.startsWith(known)) {
resolvedUrl = known;
break;
}
}

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the URL matcher allows trailing punctuation (e.g., https://foo.com,), the fragment.startsWith(known) fallback will resolve the target to the clean known URL while still hyperlinking the punctuated fragment range. This makes the visible hyperlink text include punctuation (and can interfere with split detection/pending matching), even though the link target is different. Consider trimming common trailing punctuation from matched fragments before range creation (or using a stricter URL terminator set) so the hyperlinked visible span matches the resolved target more closely.

Copilot uses AI. Check for mistakes.
Comment on lines +173 to +192
// Existing OSC 8 sequence (pass through)
const osc = line.slice(i).match(OSC8_START_RE);
if (osc) {
result += osc[0];
i += osc[0].length;
continue;
}
}

// Visible character — toggle OSC 8 at range boundaries
const targetUrl = urlAt.get(visiblePos) ?? null;
if (targetUrl !== activeUrl) {
if (activeUrl !== null) {
result += "\x1b]8;;\x07";
}
if (targetUrl !== null) {
result += `\x1b]8;;${targetUrl}\x07`;
}
activeUrl = targetUrl;
}

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the input line already contains OSC 8 hyperlinks, the code currently passes the OSC 8 escape sequences through but does not track whether it is inside an existing OSC 8 span. That can lead to nested/mismatched hyperlink sequences when applyOsc8Ranges toggles activeUrl over the same visible text. Consider detecting existing OSC 8 usage and either (a) skipping post-processing for that line, or (b) tracking OSC 8 open/close state while walking the raw string so you don’t insert new OSC 8 sequences inside an existing hyperlink.

Copilot uses AI. Check for mistakes.
});
});

describe("extractUrls", () => {

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the regex-based markdown link extraction, it would be valuable to add tests for common markdown link variants that are currently untested: link titles (e.g., [t](https://ex.com \"title\")), angle-bracket destinations ([t](<https://ex.com>)), and URLs containing )-like characters. These cases are where extractUrls() is most likely to mis-extract and cause addOsc8Hyperlinks() to fail to resolve fragments correctly.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +32
it("extracts markdown link hrefs", () => {
const urls = extractUrls("[Click here](https://example.com/path)");
expect(urls).toEqual(["https://example.com/path"]);
});

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the regex-based markdown link extraction, it would be valuable to add tests for common markdown link variants that are currently untested: link titles (e.g., [t](https://ex.com \"title\")), angle-bracket destinations ([t](<https://ex.com>)), and URLs containing )-like characters. These cases are where extractUrls() is most likely to mis-extract and cause addOsc8Hyperlinks() to fail to resolve fragments correctly.

Copilot uses AI. Check for mistakes.
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Feb 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member

you have been detected be spamming with unwarranted prs and issues and your issues and prs have been automatically closed. please read contributing guide Contributing.md.

@vincentkoc vincentkoc closed this Feb 22, 2026
@vincentkoc vincentkoc reopened this Feb 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Follow-up pushed to address review findings.

What changed:

  • tightened markdown-link URL extraction to handle optional <...> wrappers and link titles.
  • updated prefix resolution to pick the longest matching known URL when a fragment matches multiple prefixes.
  • added regression tests for both cases in src/tui/osc8-hyperlinks.test.ts.

Thanks @Phineas1500 for the original implementation.

@vincentkoc

Copy link
Copy Markdown
Member

Rebuilt this branch on current main and force-updated fix/osc8-hyperlinks.

  • cherry-picked only the two intended commits (feature + follow-up fix)
  • resolved the single conflict in src/tui/components/assistant-message.ts
  • reran targeted tests: pnpm vitest run src/tui/osc8-hyperlinks.test.ts

The PR now reports mergeable (MERGEABLE/CLEAN).

Phineas1500 and others added 3 commits February 22, 2026 18:50
Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.
@vincentkoc
vincentkoc merged commit 331b728 into openclaw:main Feb 23, 2026
24 checks passed
carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
gabrielkoo pushed a commit to gabrielkoo/openclaw that referenced this pull request Feb 23, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
desertstackdev pushed a commit to desertstackdev/openclaw that referenced this pull request Feb 28, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
* feat(tui): add OSC 8 hyperlinks to make wrapped URLs clickable

Long URLs that exceed terminal width get broken across lines by pi-tui's
word wrapping, making them unclickable. Post-process rendered markdown
output to add OSC 8 terminal hyperlink sequences around URL fragments,
so each line fragment links to the full URL. Gracefully degrades on
terminals without OSC 8 support.

* tui: harden OSC8 URL extraction and prefix resolution

* tui: add changelog entry for OSC 8 markdown hyperlinks

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: URLs broken by spaces during markdown line wrapping

4 participants