Skip to content

Handle Ghostty local URL paths#236

Merged
sbertix merged 1 commit intomainfrom
sbertix/local-url-handling
Apr 13, 2026
Merged

Handle Ghostty local URL paths#236
sbertix merged 1 commit intomainfrom
sbertix/local-url-handling

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented Apr 13, 2026

Summary

  • Handle Ghostty open_url actions for local filesystem paths directly in the app, so plain terminal paths can be opened immediately instead of only being stored in transient Ghostty state.
  • Introduce ghosttyOpenURLRequest to normalize Ghostty URL payloads into either passthrough remote URLs or standardized local file URLs, covering plain absolute paths, relative paths, paths with spaces, and tilde-prefixed paths similar to Supaterm.
  • Preserve Foundation tilde expansion semantics for local file paths, including named home directories like ~user/..., by relying on NSString(...).expandingTildeInPath instead of concatenating onto the current user home path.
  • Keep worktree path normalization aligned with that same Foundation behavior by asserting named-tilde expansion in the existing path helpers, so repository and global worktree settings continue to resolve ~user/... correctly.

Test plan

  • In a terminal surface, activate an https://... link and verify it still opens in the browser instead of being treated as a local file path.
  • In a terminal surface, activate a plain absolute local path and verify the corresponding file or folder opens correctly.
  • In a terminal surface, activate a ~/... local path and verify it resolves against the current user home directory.
  • In a terminal surface, activate a ~user/... local path and verify it resolves to that named user home directory rather than being appended to the current user home path.
  • In Worktree settings, enter a base directory using ~user/..., save, reopen the setting, and verify the resolved path and example worktree path still point at the named user home.

Closes #234

@sbertix sbertix merged commit 77afa17 into main Apr 13, 2026
1 check passed
@sbertix sbertix deleted the sbertix/local-url-handling branch April 13, 2026 22:24
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.

Fix terminal link handling for local paths

1 participant