diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index d76c23597d7a..a70aaf29ba85 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -5975,6 +5975,9 @@ struct ContentView: View { panel.allowsMultipleSelection = false panel.title = String(localized: "panel.openFolder.title", defaultValue: "Open Folder") panel.prompt = String(localized: "panel.openFolder.prompt", defaultValue: "Open") + if let cwd = tabManager.selectedWorkspace?.currentDirectory, !cwd.isEmpty { + panel.directoryURL = URL(fileURLWithPath: cwd) + } if panel.runModal() == .OK, let url = panel.url { tabManager.addWorkspace(workingDirectory: url.path) } diff --git a/Sources/cmuxApp.swift b/Sources/cmuxApp.swift index 1cc1f9fcf8fe..e192bb968144 100644 --- a/Sources/cmuxApp.swift +++ b/Sources/cmuxApp.swift @@ -593,6 +593,9 @@ struct cmuxApp: App { panel.allowsMultipleSelection = false panel.title = String(localized: "menu.file.openFolder.panelTitle", defaultValue: "Open Folder") panel.prompt = String(localized: "menu.file.openFolder.panelPrompt", defaultValue: "Open") + if let cwd = activeTabManager.selectedWorkspace?.currentDirectory, !cwd.isEmpty { + panel.directoryURL = URL(fileURLWithPath: cwd) + } if panel.runModal() == .OK, let url = panel.url { if let appDelegate = AppDelegate.shared { if appDelegate.addWorkspaceInPreferredMainWindow(