From 2aacf6e130ea4335290470c91c5530b85542b2dd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 4 Oct 2023 08:01:13 -0700 Subject: [PATCH] macos: support dropping file urls onto surfaces --- macos/Sources/Ghostty/SurfaceView.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index d187c9394..7a5bbb081 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -133,7 +133,12 @@ extension Ghostty { providers.forEach { provider in _ = provider.loadObject(ofClass: URL.self) { url, _ in guard let url = url else { return } - AppDelegate.logger.warning("OPEN url=\(url.path)") + DispatchQueue.main.async { + surfaceView.insertText( + url.path, + replacementRange: NSMakeRange(0, 0) + ) + } } }