Live data from Hacker News

How the clipboard works

whynothugo.nl

31–40 of 160 posts

Re: How the clipboard works

#31
post #8

My life was significantly improved when I discovered control shift paste, which pastes just text without format. But un-desired formatting of text remain the bane of my life.

So essential - how often would I want the formatting in the obviously completely different context? I used to paste things into the URL bar to remove formatting. I've discovered a colleague does the same.

Re: How the clipboard works

#32

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…

Middle click (aka primary selection) is very similar, it's essentially the same interface with a new namespace:

https://wayland.app/protocols/primary-selection-unstable-v1

Re: How the clipboard works

#33
It's remarkable to me how we still don't have a security-minded clipboard implementation, seemingly on any OS. It's standard security practice now to use a password manager, but they all[1] exchange critically sensitive data with applications via the clipboard, which is accessible by any application that asks for it. The best we can do is automatically clear the clipboard after a certain time, but this still leaves a wide window for any application to grab the contents. And if you're using a clipboard manager, the standard on Linux DEs, then you have to remember to clear it from there afterwards as well, and suddenly your clipboard manager is a very attractive honey pot.

We need a secure channel for password managers to pass credentials to applications that a) doesn't use the system clipboard, and b) doesn't simulate the keyboard to type into the password field. All modern OSs fail in this regard, AFAICT.

[1]: Except the ones that function as a browser extension and are used for logging into websites. But using something as critical as a password manager from a browser extension might be an even worse security practice than using the clipboard.

Re: How the clipboard works

#34
post #33

It's remarkable to me how we still don't have a security-minded clipboard implementation, seemingly on any OS. It's standard security practice now to use a password manager, but they all[1] exchange critically sensitive data with applications via the clipboard, which is accessible by any application that asks for it. The best we can do is automatically clear the clipboard after a certain time, but this still leaves a…

[deleted]

Re: How the clipboard works

#35

This design has the really annoying situation that applications closing down can't leave stuff in the clipboard. This results in a quite a frustrating behavior for users and also makes command line tools tricky. wl-clipboard lets you pipe text into the command to copy. The way it works is that it daemonizes in the background to fulfill the copy request. It either cancels on the first paste (command) or until some oth…

[deleted]

Re: How the clipboard works

#36
post #33

It's remarkable to me how we still don't have a security-minded clipboard implementation, seemingly on any OS. It's standard security practice now to use a password manager, but they all[1] exchange critically sensitive data with applications via the clipboard, which is accessible by any application that asks for it. The best we can do is automatically clear the clipboard after a certain time, but this still leaves a…

Drag-and-drop works pretty nicely with most password managers, avoiding the clipboard (in Windows at least).

In Android, it's a case of using a password manager with a built-in keyboard, and having a button available to switch keyboards quickly.

Re: How the clipboard works

#37

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…

> 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.

Personally I haven't had this problem: just like the article says, the browser ‘copies’ image data with a correct mime-type, and the other app pastes the image if it knows about that mime-type. This is on MacOS, with Firefox.

(Though, again personally, I now usually scale the image and convert to webp before sending in a chat—I don't do much email. This way I'm avoiding 4K 4MB pics. I'm probably gonna make me a browser extension to do this automatically.)

You're right however that drag-n-drop doesn't work so smoothly yet.

Re: How the clipboard works

#38

Given how much memory we have available these days, would we build it the same way? Having copy paste usually work outta the box everywhere might be more valuable than memory savings. Sidebar: I do at this point use a copy paste history app anyways that saves and plain text-ifies everything.

What's the app?

Re: How the clipboard works

#39
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.

> 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"

This never happens if you only use the unix clipboard. I agree that both methods should point to the same clipboard, but this is an implementation detail. The important thing is the interface: selecting text copies it to the clipboard, middle-clicking pastes it.

Post reply on HN