Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,11 @@ class FileViewModel: ObservableObject, Identifiable, FileSystemItemViewModel, Eq

func openInDefaultApp() {
let fileURL = URL(fileURLWithPath: standardizedFullPath)
let opened = NSWorkspace.shared.open(fileURL)
if !opened {
print("Unable to open file: \(standardizedFullPath)")
let configuration = NSWorkspace.OpenConfiguration()
NSWorkspace.shared.open(fileURL, configuration: configuration) { _, error in
if let error {
print("Unable to open file: \(self.standardizedFullPath): \(error)")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11751,7 +11751,13 @@ extension WorkspaceFilesViewModel {
guard standardizedPath.hasPrefix("/") else { return false }

let fileURL = URL(fileURLWithPath: standardizedPath)
return NSWorkspace.shared.open(fileURL)
let configuration = NSWorkspace.OpenConfiguration()
NSWorkspace.shared.open(fileURL, configuration: configuration) { _, error in
if let error {
print("Unable to open file: \(standardizedPath): \(error)")
}
}
return true
}

@MainActor
Expand Down
Loading