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:
Qwerasd
2024-03-07 20:53:48 -05:00
parent b3e411add8
commit d1ac0aff39
4 changed files with 25 additions and 2 deletions

View File

@@ -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 }