[BUG] Deep link from Linear opens Ghostty without correct working directory

Resolved 💬 2 comments Opened Mar 20, 2026 by jaywang5540 Closed Apr 18, 2026

Bug Description

When opening Claude Code via deep link from Linear (using "Open in Claude Code" with a specified directory), Terminal.app correctly opens in the selected working directory, but Ghostty does not — it opens in the home directory or inherits from a previously focused Ghostty window.

Steps to Reproduce

  1. Open a Linear issue
  2. Click "Open in Claude Code" → select a project directory (e.g., ~/Desktop/work_code/meepo/meepo-wallet-se)
  3. With Ghostty (v1.3.1) set as the default terminal on macOS
  4. Ghostty opens, but the working directory is not the selected directory

Expected Behavior

Ghostty should open with the working directory set to the directory selected in Linear's deep link UI.

Actual Behavior

  • Terminal.app: Working directory is correctly set (presumably via AppleScript do script "cd /path && ...")
  • Ghostty: Working directory defaults to ~ or inherits from a previously focused Ghostty window, ignoring the selected directory

Root Cause Analysis

Ghostty 1.3.0+ supports AppleScript with a surface configuration that includes initial working directory. Claude Code's deep link handler likely doesn't use this API for Ghostty.

The correct AppleScript for Ghostty would be:

tell application "Ghostty"
    set cfg to new surface configuration
    set initial working directory of cfg to "/path/to/selected/directory"
    set command of cfg to "claude ..."
    set win to new window with configuration cfg
end tell

Reference: Ghostty AppleScript documentation

Environment

  • macOS: Darwin 25.3.0
  • Ghostty: 1.3.1 (stable)
  • Claude Code: 2.1.78 (native install)
  • Linear: Desktop app (macOS)

Additional Context

Ghostty's AppleScript support was added in v1.3.0 (released March 9, 2026). The initial working directory property on surface configuration is the correct way to set working directory when creating new windows/tabs programmatically.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗