Hacker News new | ask | show | jobs
by AlienRobot 601 days ago
That's an interesting question.

When you select and copy text, text data (typically UTF-8 encoded) is copied to a temporary area called the clipboard (except on X11, where the clipboard doesn't actually exist). When you select and copy an image, the pixel data (24bpp or 32bpp bitmap) is copied to the clipboard. This means you can copy text or image data from one application and paste it into another.

When you copy and paste files within a file manager, data isn't transferred across applications. The data copied is just text data with a special tag indicating it was copied from the file manager. When you paste it, the file manager performs the copy action from one filepath to another. Similarly, when you copy clips within a video-editing application or 3D models or anything more complex than just text and image, it's all done by copying a reference to the data within the application, so you can never paste it outside the application.

You can't, for example, copy a video from DaVinci Resolve and paste it in KDEnlive. You also can't copy and paste audio data.

For some reason, the clipboard is confined to text and image.

The same applies to drag and drop, by the way. If you drag and drop an image to a file manager, either it will pass a URL (text data) and the file manager handles downloading it from the source, or, on Windows, it gives the file manager the filepath of the image the browser already downloaded in cache so it copies without downloading anything.