Skip to content

macOS: Add macos-dock-drop-folder-behavior (new tab or window) configuration option #8114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kgn
Copy link

@kgn kgn commented Jul 31, 2025

This PR adds a new configuration option macos-dock-drop-folder-behavior that controls whether folders dropped onto the Ghostty dock icon open in a new tab (default) or a new window.

Changes

Configuration Option Added

  • Option name: macos-dock-drop-folder-behavior
  • Valid values:
    • tab (default) - Opens folders in a new tab in the main window
    • window - Opens folders in a new window
  • Platform: macOS only

Files Modified

  1. src/config/Config.zig

    • Added MacOSDockDropFolderBehavior enum with tab and window values
    • Added configuration field with default value of .tab
    • Added documentation explaining the option
  2. macos/Sources/Ghostty/Package.swift

    • Added MacOSDockDropFolderBehavior enum to match the Zig enum
  3. macos/Sources/Ghostty/Ghostty.Config.swift

    • Added macosDockDropFolderBehavior computed property to access the configuration value from Swift
  4. macos/Sources/App/macOS/AppDelegate.swift

    • Modified application(_:openFile:) method to check the configuration
    • When a folder is dropped on the dock icon, it now respects the user's preference

Usage

Add to your Ghostty configuration file:

macos-dock-drop-folder-behavior = window

Motivation

This feature is useful for users (like me!) who prefer window-based workflows over tab-based workflows when opening folders via drag and drop on macOS.

This adds a new configuration option that controls whether folders
dropped onto the Ghostty dock icon open in a new tab (default) or
a new window.

The option accepts two values:
- tab: Opens folders in a new tab in the main window (default)
- window: Opens folders in a new window

This is useful for users who prefer window-based workflows over
tab-based workflows when opening folders via drag and drop.
@kgn kgn requested a review from a team as a code owner July 31, 2025 19:38
@kgn kgn changed the title macOS: Add macos-dock-drop-folder-behavior configuration option macOS: Add macos-dock-drop-folder-behavior (new tab or window) configuration option Jul 31, 2025
@00-kat 00-kat added os/macos gui GUI or app issue regardless of platform (i.e. Swift, GTK) labels Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants