diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index 272f16e5a..7e76e3554 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -2220,7 +2220,6 @@ extension Ghostty.SurfaceView { static let dropTypes: Set = [ .string, .fileURL, - .URL ] override func draggingEntered(_ sender: any NSDraggingInfo) -> NSDragOperation { @@ -2240,24 +2239,7 @@ extension Ghostty.SurfaceView { override func performDragOperation(_ sender: any NSDraggingInfo) -> Bool { let pb = sender.draggingPasteboard - let content: String? - if let url = pb.string(forType: .URL) { - // URLs first, they get escaped as-is. - content = Ghostty.Shell.escape(url) - } else if let urls = pb.readObjects(forClasses: [NSURL.self]) as? [URL], - urls.count > 0 { - // File URLs next. They get escaped individually and then joined by a - // space if there are multiple. - content = urls - .map { Ghostty.Shell.escape($0.path) } - .joined(separator: " ") - } else if let str = pb.string(forType: .string) { - // Strings are not escaped because they may be copy/pasting a - // command they want to execute. - content = str - } else { - content = nil - } + let content = pb.getOpinionatedStringContents() if let content { DispatchQueue.main.async {