Skip to content

fix: resolve ghostty app path dynamically for reliable launch#119

Merged
neonwatty merged 3 commits intomainfrom
fix/ghostty-launcher-cli
Apr 18, 2026
Merged

fix: resolve ghostty app path dynamically for reliable launch#119
neonwatty merged 3 commits intomainfrom
fix/ghostty-launcher-cli

Conversation

@neonwatty
Copy link
Copy Markdown
Collaborator

Summary

  • Resolves the Ghostty binary dynamically: checks PATH first, falls back to /Applications/Ghostty.app/Contents/MacOS/ghostty (closes Ghostty launcher: -e flag not working correctly via open -na on macOS #29)
  • Uses open -na <resolved-app-path> for launch (fire-and-forget), keeping the CLI binary for --version checks during verify()
  • The direct ghostty -e invocation blocks until the window closes, which would timeout after 10s — open -na returns immediately after delivering the launch event
  • Updates unit and integration test expectations

Test plan

  • pnpm turbo typecheck passes
  • pnpm turbo test — 398 tests pass (including updated ghostty.test.ts)
  • buildGhosttyArgs produces ["-na", appPath, "--args", "--title=...", "-e", ...]
  • resolveGhostty() returns both binary and appPath

macOS `open` doesn't forward the `-e` flag correctly to Ghostty,
causing the shell path to be typed as text into the default session
instead of executing as a new process. Use the `ghostty` binary
directly which handles `-e` correctly.
Tests expected the old open -na args array layout. Updated indices
to match the new ghostty CLI binary invocation.
The direct ghostty CLI binary blocks until the window closes, causing
a 10s timeout on every launch. Reverted to open -na (fire-and-forget)
but now resolves the .app bundle path dynamically instead of
hardcoding "Ghostty.app". The CLI binary is still used for --version
checks during verify().
@neonwatty neonwatty added this pull request to the merge queue Apr 18, 2026
Merged via the queue into main with commit 00501a4 Apr 18, 2026
5 checks passed
@neonwatty neonwatty deleted the fix/ghostty-launcher-cli branch April 18, 2026 20:56
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.

Ghostty launcher: -e flag not working correctly via open -na on macOS

1 participant