mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-28 02:03:55 +00:00
Add macos-dock-drop-folder-behavior configuration option
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.
This commit is contained in:
committed by
Mitchell Hashimoto
parent
d20376c1ff
commit
f9ad061ea8
@@ -402,11 +402,17 @@ class AppDelegate: NSObject,
|
||||
var config = Ghostty.SurfaceConfiguration()
|
||||
|
||||
if (isDirectory.boolValue) {
|
||||
// When opening a directory, create a new tab in the main
|
||||
// window with that as the working directory.
|
||||
// If no windows exist, a new one will be created.
|
||||
// When opening a directory, check the configuration to decide
|
||||
// whether to open in a new tab or new window.
|
||||
config.workingDirectory = filename
|
||||
_ = TerminalController.newTab(ghostty, withBaseConfig: config)
|
||||
|
||||
let behavior = ghostty.config.macosDockDropFolderBehavior
|
||||
if behavior == .window {
|
||||
_ = TerminalController.newWindow(ghostty, withBaseConfig: config)
|
||||
} else {
|
||||
// Default to tab behavior
|
||||
_ = TerminalController.newTab(ghostty, withBaseConfig: config)
|
||||
}
|
||||
} else {
|
||||
// When opening a file, we want to execute the file. To do this, we
|
||||
// don't override the command directly, because it won't load the
|
||||
|
||||
Reference in New Issue
Block a user