diff --git a/macos/Sources/Ghostty/Ghostty.App.swift b/macos/Sources/Ghostty/Ghostty.App.swift index bdc64e9e1..bf34b4a91 100644 --- a/macos/Sources/Ghostty/Ghostty.App.swift +++ b/macos/Sources/Ghostty/Ghostty.App.swift @@ -637,8 +637,9 @@ extension Ghostty { switch action.kind { case .text: - // Open with the default text editor - if let textEditor = NSWorkspace.shared.defaultTextEditor { + // Open with the default editor for `*.ghostty` file or just system text editor + let editor = NSWorkspace.shared.defaultApplicationURL(forExtension: url.pathExtension) ?? NSWorkspace.shared.defaultTextEditor + if let textEditor = editor { NSWorkspace.shared.open([url], withApplicationAt: textEditor, configuration: NSWorkspace.OpenConfiguration()) return true }