Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(kanban): make OSC 8 + URL links clickable in the card modal

enese73d4b4d3b66
diff --git a/src/renderer/components/kanban/ModalTerminal.tsx b/src/renderer/components/kanban/ModalTerminal.tsx
index d2cec5a08..0326c8fa4 100644
--- a/src/renderer/components/kanban/ModalTerminal.tsx
+++ b/src/renderer/components/kanban/ModalTerminal.tsx
@@ -17,7 +17,11 @@ import { useTerminalSearch } from '../../terminal/useTerminalSearch'
import { LocalTransport } from '../../terminal/local-transport'
import { clipboardImages, droppedPaths, pasteHasText, pastedFiles } from '../../terminal/file-drop'
import { guardMiddleClickPaste } from '../../terminal/middle-click'
-import { createOsc8LinkHandler } from '../../terminal/file-links'
+import {
+ createOsc8LinkHandler,
+ createUrlLinkProvider,
+ installLinkClickFallback
+} from '../../terminal/file-links'
import { parseOsc52 } from '../../terminal/osc52'
import { activateUnicode11 } from '../../terminal/unicode-width'
import { useCopyFeedback } from '../../terminal/useCopyFeedback'
@@ -189,6 +193,28 @@ export function ModalTerminal({ nodeId, spawn, searchOpen, onCloseSearch }: Moda
let dead = false
const cleanups: Array<() => void> = []
+ // MIRROR TerminalNode's link wiring, minus file links. The provider handles Cmd/Ctrl+click on
+ // URL text when mouse-reporting is off (plain-shell sessions); the capture-phase fallback is
+ // what works under tmux/agent mouse-reporting — the norm, and the only path on which the OSC 8
+ // linkHandler above can ever fire in a tmux-backed session (xterm's own link activation is
+ // swallowed by the mouse report, see installLinkClickFallback). File links stay a canvas-node
+ // affordance: the modal has no project-fs/dialect routing, and resolving a path against the
+ // wrong machine is worse than not linking it — hence fileEnabled: false, not stub deps that
+ // pretend to resolve.
+ const openUrl = (uri: string): void => window.nodeTerminal.shell.openExternal(uri)
+ term.registerLinkProvider(createUrlLinkProvider(term, openUrl))
+ if (term.element) {
+ cleanups.push(
+ installLinkClickFallback(term, term.element, {
+ getCwd: () => undefined,
+ lookup: () => Promise.resolve({ exists: false, dir: false }),
+ activateFile: () => {},
+ openUrl,
+ fileEnabled: () => false
+ }).dispose
+ )
+ }
+
// MIRROR TerminalNode "WRITE-ONLY — `parseOsc52` returns null" — the OSC 52 clipboard-write path.
// tmux's mouse is ON, so a drag-select in copy-mode emits OSC 52 to this client; this handler
// writes the system clipboard. `parseOsc52` returns null for a `?` read query so a remote program
diff --git a/src/shared/ssh.test.ts b/src/shared/ssh.test.ts
index ee587ea24..b971798b0 100644
--- a/src/shared/ssh.test.ts
+++ b/src/shared/ssh.test.ts
@@ -265,6 +265,7 @@ describe('remoteTmuxConf', () => {
// label text — a link whose URL is not also printed can then never be opened.
expect(c).toContain('set -as terminal-features ",*:hyperlinks"')
})
+
it('clears the override/feature arrays a long-lived server accumulated from older versions', () => {
// A tmux server outlives the app and keeps every entry ever sourced into it; the stale
// smcup@/rmcup@/indn@ entries would otherwise keep breaking scrolling forever. Measured: