TIL on January 24, 2026
How copy + paste works
Copy + paste seems obvious: copying puts a thing in a box, pasting retrieves the thing from the box.
But that’s not what’s happening under the hood.
When you copy something from an app, the source app registers the possible formats for that data it could provide. It might instantly serialize basic formats (like plain text), but it does not serialize every possible format since to preserve memory and performance.
When you paste something, the destination app looks at the promises from the source app and requests its preferred format. At this point the source app fulfills the promise and provides the data in the required format.
This explains why copy + paste works different depending on the destination of the paste event: the destination app (email, spreadsheet, document, etc) chooses the format it wants to receive from the set of available promises.
macOS does a lot of work under the hood to attempt serialization of common data types when the source app is closed. But there may still be edge cases where if you copy something, close the source app, and then attempt to paste elsewhere, the source can not fulfill its request and the pasted content will be corrupted.
Copy and paste is not putting things into a box and pulling them out later. It’s brokering promises between apps.