Skip to content

macOS: read string contents per pasteboard item#13170

Open
bo2themax wants to merge 2 commits into
ghostty-org:mainfrom
bo2themax:push-1da9cc0d
Open

macOS: read string contents per pasteboard item#13170
bo2themax wants to merge 2 commits into
ghostty-org:mainfrom
bo2themax:push-1da9cc0d

Conversation

@bo2themax

Copy link
Copy Markdown
Member

Fixes: #4956, regression from: #4956

AI Disclosure

Claude wrote the tests before I changed getOpinionatedStringContents

claude and others added 2 commits July 3, 2026 12:53
@bo2themax bo2themax requested a review from a team as a code owner July 3, 2026 11:31
@ghostty-bot ghostty-bot Bot added the os/macos label Jul 3, 2026
.joined(separator: " ")
let strings = (pasteboardItems ?? []).compactMap { item in
if let plist = item.propertyList(forType: .fileURL),
let fileURL = NSURL(pasteboardPropertyList: plist, ofType: .fileURL) as URL?,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can theoretically read string(forType: .fileURL) then URL.init(string:), but I want to keep the behavior as close to previous version as much possible. I assume readObjects(forClasses: [NSURL.self]) is using NSPasteboardReading internally as well based on the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants