Skip to content

Fix terminal hyperlinks and wrapped selection copying - #2479

Open
fdx-peter wants to merge 1 commit into
get-bb:mainfrom
fdx-peter:fix/terminal-osc8-links
Open

Fix terminal hyperlinks and wrapped selection copying#2479
fdx-peter wants to merge 1 commit into
get-bb:mainfrom
fdx-peter:fix/terminal-osc8-links

Conversation

@fdx-peter

@fdx-peter fdx-peter commented Aug 26, 2026

Copy link
Copy Markdown

Human comments

Yeah so basically I tried to claude /login in a terminal and the inability to click the long auth link (or copy-paste) was super fustrating......so I told bb to fix itself.

What was wrong

The host terminal environment did not advertise OSC 8 support, so programs using supports-hyperlinks-style detection could flatten named hyperlinks into display text and discard the target. The clients also did not install an OSC 8 activation handler, and desktop/web context-menu copying did not use xterm's logical selection, so a soft-wrapped selection could be reduced to one rendered row. See #2469.

What changed

  • Advertise hyperlink support to spawned terminal processes with FORCE_HYPERLINK=1.
  • Route desktop/web OSC 8 activation through bb's URL navigation after disclosing and confirming the exact target in bb's responsive dialog; visibly detected URLs retain direct activation.
  • Add terminal context-menu actions for opening/copying links and copying the exact xterm selection across soft-wrapped rows.
  • Route mobile OSC 8 activation through the native bridge and require confirmation showing the exact URL before opening it.
  • Preserve link provenance through the mobile bridge so visibly detected URLs still open directly, matching desktop/web behavior.
  • Regenerate the committed mobile terminal page and add regression coverage for the host environment, desktop/web handlers, mobile confirmation, and generated asset parity.
  • No HOST_DAEMON_PROTOCOL_VERSION bump is needed because this changes only the environment of newly spawned PTYs; no server/daemon wire field or message changed.
  • FORCE_HYPERLINK is the available opt-in for programs that do not recognize bb as a terminal. Programs that treat it as an unconditional override may also emit OSC 8 when their output is redirected; callers requiring plain redirected output can set FORCE_HYPERLINK=0 for that command.

How you verified

  • App terminal test suite — 41 tests passed.
  • Focused host-daemon terminal tests — 29 tests passed.
  • Mobile terminal test suite — 32 tests passed.
  • pnpm exec turbo run typecheck lint --filter=@bb/app --filter=@bb/host-daemon --filter=@bb/mobile — all tasks passed; lint reported 0 errors.
  • pnpm run build — all 12 production build tasks passed.
  • Oxfmt and git diff --check passed for the changed source files.
  • Exercised the full flow with Computer Use against an isolated development instance: OSC 8 confirmation/open, direct visible-URL opening, combined link/selection context menu, and copying a 620-character soft-wrapped selection as one logical value.

Fixes #2469

AGENT GENERATED

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal hyperlink targets can become inaccessible in bb

1 participant