Live data from Hacker News

How the clipboard works

whynothugo.nl

21–30 of 160 posts

Re: How the clipboard works

#21

Good refresher, nice share. I wish there was a little more transparency in the clipboard. When I press WinKey+V, Windows 10 only shows me one format but often pastes a different one (obviously) -- would be nice to have the option to allow me to look into the possible formats I can get out.

> would be nice to have the option to allow me to look into the possible formats I can get out. That would only confuse an average Joe so don't have high hopes. IMMSMW there was a program what would show which formats are available for the current content, but hell if I remember how it was called and was it a regular program or just an exercise in Win32 API. Maybe it was in Raymond Chen's blog. But if you are interes…

Agree on confuse, the option would have to be something hidden in settings.

Anyway, I will look into links, thanks.

Re: How the clipboard works

#22

For those wondering about how Windows does this, there is, as you'd expect, a Raymond Chen article about it: https://devblogs.microsoft.com/oldnewthing/20210526-00/?p=10... (and some more, like https://devblogs.microsoft.com/oldnewthing/20220608-00/?p=10... ) Elsewhere in these comments there is also a link to an explainer for the macOS equivalent. Here's also an explainer for X11: https://www.uninformativ.de/blog/po…

> It's interesting to look at these clipboard APIs together to see what may have led to the Wayland design

If that lead to Wayland then I think people took away the wrong lessons. Wayland's current protocol / API for clipboards is incredibly annoying. It's hard to deal with for applications, it's even harder to deal with for clipboard managers which were not really considered in that design and usually break the clipboard in different ways.

I have never seen that many bug reports and issues with clipboard behavior as with wayland. If there is a benefit to the design, then it's entirely non obvious to me.

Re: How the clipboard works

#23

No word about unix-style clipboard? Select to copy, middle-click to paste. If I had to highlight an immediate usability advantage of linux with respect to windows and macos, it would be clearly this thing. It feels "at home" when you can do this. Also, I have a viscerally strong disagreement with the following sentence: > The majority of the implementations out there are broken and only handle text. For me, one of th…

Most people want to copy and paste files and images

I understand this concern. But it seems that it would be better to have an orthogonal implementation of this. The clipboard remains text-only. If you select an image or a file, it copies its absolute path (or url) into the clipboard. Then it is the responsibility of the destination program to interpret what to do with this text. If you paste the filename of an image into a plain text editor, you'll get the filename verbatim. If you paste it into an image editor, it opens and pastes the image in there. But from the point of view of the clipboard it's always just text (maybe with some textual markers).

Re: How the clipboard works

#24

No word about unix-style clipboard? Select to copy, middle-click to paste. If I had to highlight an immediate usability advantage of linux with respect to windows and macos, it would be clearly this thing. It feels "at home" when you can do this. Also, I have a viscerally strong disagreement with the following sentence: > The majority of the implementations out there are broken and only handle text. For me, one of th…

Most people want to copy and paste files and images

I find the clipboard increasingly broken for this usecase...

Imagine I want to copy an image from a webpage into an email... And then the paste fails because the email client tries to download the image but doesn't have the correct cookies and fails...

Or I want to copy a file from Google drive onto a USB. But when you copy from the Google drive webUI it just copies the name of the file, not the file itself...

Or I copy an image from Google images and the thumbnail low Res version is copied rather than the full res version.

Copy and paste, and drag and drop, seem to be neglected on the web.

Re: How the clipboard works

#25

Earlier quoted context omitted.

Most people want to copy and paste files and images

I find the clipboard increasingly broken for this usecase... Imagine I want to copy an image from a webpage into an email... And then the paste fails because the email client tries to download the image but doesn't have the correct cookies and fails... Or I want to copy a file from Google drive onto a USB. But when you copy from the Google drive webUI it just copies the name of the file, not the file itself... Or I c…

those are limitations of the browser, not the OS

Re: How the clipboard works

#26

Earlier quoted context omitted.

I find the clipboard increasingly broken for this usecase... Imagine I want to copy an image from a webpage into an email... And then the paste fails because the email client tries to download the image but doesn't have the correct cookies and fails... Or I want to copy a file from Google drive onto a USB. But when you copy from the Google drive webUI it just copies the name of the file, not the file itself... Or I c…

those are limitations of the browser, not the OS

But the user doesn't care whose fault it is. The end result is they get a poor and frustrating experience.

Re: How the clipboard works

#27

No word about unix-style clipboard? Select to copy, middle-click to paste. If I had to highlight an immediate usability advantage of linux with respect to windows and macos, it would be clearly this thing. It feels "at home" when you can do this. Also, I have a viscerally strong disagreement with the following sentence: > The majority of the implementations out there are broken and only handle text. For me, one of th…

I don't think having two different clipboard implementations is a usability advantage. Only on Linux do you find yourself in the situation where one application copied to the Unix clipboard, and another tries to paste from the "secondary" (X11?) one. Standardizing on one implementation is the only sane path forward.

Re: How the clipboard works

#28
post #27

No word about unix-style clipboard? Select to copy, middle-click to paste. If I had to highlight an immediate usability advantage of linux with respect to windows and macos, it would be clearly this thing. It feels "at home" when you can do this. Also, I have a viscerally strong disagreement with the following sentence: > The majority of the implementations out there are broken and only handle text. For me, one of th…

I don't think having two different clipboard implementations is a usability advantage. Only on Linux do you find yourself in the situation where one application copied to the Unix clipboard, and another tries to paste from the "secondary" (X11?) one. Standardizing on one implementation is the only sane path forward.

[deleted]

Re: How the clipboard works

#29

Earlier quoted context omitted.

those are limitations of the browser, not the OS

But the user doesn't care whose fault it is. The end result is they get a poor and frustrating experience.

It's the user's fault, though.

If they don't understand the difference between copy pasting HTML with an image inside the tag soup (select with mouse a bunch of text and image and right click copy) and an image (hover image and right click "copy image") then there's not much anybody can do.

Do you want clippy in the browser "looks like you are trying to copy an image" ?

Re: How the clipboard works

#30

Earlier quoted context omitted.

Most people want to copy and paste files and images

I understand this concern. But it seems that it would be better to have an orthogonal implementation of this. The clipboard remains text-only. If you select an image or a file, it copies its absolute path (or url) into the clipboard. Then it is the responsibility of the destination program to interpret what to do with this text. If you paste the filename of an image into a plain text editor, you'll get the filename v…

Or better: The data URI gets copied.
Post reply on HN