mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-30 23:18:36 +00:00
feat(macOS): Paste copied files as absolute paths.
Previously files would be pasted as only the filename. This commit introduces an extension to NSPasteboard which provides a method to consistently get the string contents of a pasteboard so that the behavior can stay the same anywhere where we need to do that.
This commit is contained in:
@@ -1041,7 +1041,8 @@ extension Ghostty.SurfaceView: NSServicesMenuRequestor {
|
||||
}
|
||||
|
||||
func readSelection(from pboard: NSPasteboard) -> Bool {
|
||||
guard let str = pboard.string(forType: .string) else { return false }
|
||||
guard let str = pboard.getOpinionatedStringContents()
|
||||
else { return false }
|
||||
|
||||
let len = str.utf8CString.count
|
||||
if (len == 0) { return true }
|
||||
|
Reference in New Issue
Block a user