Skip to content
Open
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
933eee1
feat: route local file path clicks to markdown panel
Tim-Feng Mar 16, 2026
b45ca48
fix: validate file exists and is not a directory before opening markd…
Tim-Feng Mar 16, 2026
aa52010
fix: fall back to system handler when markdown split creation fails
Tim-Feng Mar 16, 2026
efbbd16
refactor: address CodeRabbit review feedback
Tim-Feng Mar 16, 2026
d84fdbf
docs: tmux control mode integration plan
Tim-Feng Mar 17, 2026
58ecc93
[BEHAVIORAL] Phase 1 tmux control mode bridge
Tim-Feng Mar 17, 2026
6ab1ec2
[BEHAVIORAL] cmd+click path detection in tmux control mode
Tim-Feng Mar 18, 2026
af76ebe
[BEHAVIORAL] Phase 2 tmux pane rendering — native surface per pane
Tim-Feng Mar 18, 2026
251dc33
[BEHAVIORAL] tmux pane IME improvements
Tim-Feng Mar 19, 2026
45fe7d6
[BEHAVIORAL] Terminal.clone initial sync + IME preedit cursor bar
Tim-Feng Mar 19, 2026
507fe43
[BEHAVIORAL] Auto-add -CC for tmux attach/new in shell integration
Tim-Feng Mar 19, 2026
71944b6
[BEHAVIORAL] tmux CC: cmd+click file open, paste, arrow keys, $TMUX fix
Tim-Feng Mar 19, 2026
d70f132
[BEHAVIORAL] tmux CC: route mouseDragged to pane surface for text sel…
Tim-Feng Mar 19, 2026
c7f8704
[BEHAVIORAL] VT parser: absorb ESC k (tmux set-title) to fix pane ren…
Tim-Feng Mar 20, 2026
a31b8a3
[STRUCTURAL] Add parser test for ESC k tmux set-title absorption
Tim-Feng Mar 20, 2026
0220de2
[STRUCTURAL] Revert status bar gap — container covers full area
Tim-Feng Mar 20, 2026
c4237f1
[BEHAVIORAL] tmux CC: native status bar with session/window info
Tim-Feng Mar 20, 2026
9b1e923
[BEHAVIORAL] tmux CC: prefix key layer + detach support
Tim-Feng Mar 20, 2026
384b818
[BEHAVIORAL] tmux CC: initial sync via capture-pane
Tim-Feng Mar 20, 2026
26b7823
[BEHAVIORAL] tmux CC: initial sync with geometry-aware capture-pane
Tim-Feng Mar 20, 2026
3964ae8
[BEHAVIORAL] tmux CC: fix host terminal bleed-through + simplify init…
Tim-Feng Mar 21, 2026
379c59c
[BEHAVIORAL] tmux CC: hide host terminal with alphaValue + cursor-bas…
Tim-Feng Mar 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions Sources/GhosttyTerminalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,14 @@ func cmuxPasteboardImagePathForTesting(_ pasteboard: NSPasteboard) -> String? {
enum TerminalOpenURLTarget: Equatable {
case embeddedBrowser(URL)
case external(URL)
case internalFile(String)

var url: URL {
switch self {
case let .embeddedBrowser(url), let .external(url):
return url
case let .internalFile(path):
return URL(fileURLWithPath: path)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}
}
}
Expand Down Expand Up @@ -457,13 +460,19 @@ func resolveTerminalOpenURLTarget(_ rawValue: String) -> TerminalOpenURLTarget?

if NSString(string: trimmed).isAbsolutePath {
#if DEBUG
dlog("link.resolve result=external(absolutePath) url=\(trimmed)")
dlog("link.resolve result=internalFile(absolutePath) path=\(trimmed)")
#endif
return .external(URL(fileURLWithPath: trimmed))
return .internalFile(trimmed)
}

if let parsed = URL(string: trimmed),
let scheme = parsed.scheme?.lowercased() {
if scheme == "file" {
#if DEBUG
dlog("link.resolve result=internalFile(fileURL) path=\(parsed.path)")
#endif
return .internalFile(parsed.path)
}
if scheme == "http" || scheme == "https" {
guard BrowserInsecureHTTPSettings.normalizeHost(parsed.host ?? "") != nil else {
#if DEBUG
Expand Down Expand Up @@ -2316,6 +2325,49 @@ class GhosttyApp {
}
}
switch target {
case let .internalFile(path):
#if DEBUG
dlog("link.openURL target=internalFile, opening in markdown panel path=\(path)")
#endif
// Validate the path is a readable file (not a directory or missing).
// Fall back to system handler if validation fails.
var isDir: ObjCBool = false
let fileExists = FileManager.default.fileExists(atPath: path, isDirectory: &isDir)
guard fileExists, !isDir.boolValue else {
#if DEBUG
dlog("link.openURL internalFile not a readable file, falling back to external path=\(path)")
#endif
return performOnMain {
NSWorkspace.shared.open(URL(fileURLWithPath: path))
}
}
let sourceWorkspaceId = callbackTabId ?? surfaceView.tabId
let sourcePanelId = callbackSurfaceId ?? surfaceView.terminalSurface?.id
guard let sourceWorkspaceId, let sourcePanelId else {
return performOnMain {
NSWorkspace.shared.open(URL(fileURLWithPath: path))
}
}
return performOnMain {
guard let app = AppDelegate.shared,
let resolved = app.workspaceContainingPanel(
panelId: sourcePanelId,
preferredWorkspaceId: sourceWorkspaceId
) else {
NSWorkspace.shared.open(URL(fileURLWithPath: path))
return true
}
if resolved.workspace.newMarkdownSplit(
from: sourcePanelId,
orientation: .horizontal,
filePath: path
) != nil {
return true
}
// Split creation failed — fall back to system handler
NSWorkspace.shared.open(URL(fileURLWithPath: path))
return true
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
case let .external(url):
#if DEBUG
dlog("link.openURL target=external, opening externally url=\(url)")
Expand Down