Live data from Hacker News

How the clipboard works

whynothugo.nl

41–50 of 160 posts

Re: How the clipboard works

#41

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…

But I already downloaded the image, I don't want to download it again. What if I want to copy a subsection of an image from an image editor, there is no textual representation as it is not a file on disk.

Re: How the clipboard works

#42

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’m not really sure what middle click has to do with clipboard implementation.

Anyway, I use the clipboard mostly to move images I don’t want to save to a file, so I would hate to have them converted to plain text.

I would also be surprised if I copied a text selection from a website into open office and had to manually redo all the bolds and italics.

Re: How the clipboard works

#43

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…

The Linux clipboard feels like home to me too, but let's not kid ourselves. Between primary, secondary, and clipboard, it's part of the learning cliff (cos it's steeper than a curve) that is linux. It's totally inscrutable!

ctrl-v and shift-ctrl-v and middle click and shift-middle click and tmux and vim.

The damned system makes no sense! Probably why it feels like home, once you're used to it.

Re: How the clipboard works

#44

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 absolutely hate select to copy. It mostly ends up with me overwriting the clipboard unintentionally with data I don’t care about.

I quite like ctrl-c/ctrl-V (or cmd on a mac). Very easy to use while controlling the mouse with the other hand.

Re: How the clipboard works

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

GitHub started mangling text some months ago and it bugs the hell out of me. It's also completely unnecessary as GitHub already links things like @user, #123, and deadbeef (for commit hashes). I just want to copy the exact literal text I see; why does that need to be hard?

You can set "dom.event.clipboardevents.enabled" in Firefox to disable all of that, but some websites can break horribly because they just assume it's there and will do $weird_shit if it's not. e.g. Twitter and Facebook messenger for example; it's not that you get an error either, it just behaved in really odd ways. It seems Twitter works now in quick test, and I no longer need to use Facebook Messenger, so let's try setting it again.

There's also "clipboard.plainTextOnly", but it doesn't seem to work, or maybe it does something different from what I expect.

Re: How the clipboard works

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

You might want to be careful about pasting anything remotely sensitive into the URL bar as most browser automatically send your query to the search engine for auto-complete functionality.

Re: How the clipboard works

#47
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…

Are there "clipboard snoopers" out there? Or more specifically, are there clipboard snoopers that access sensitive data they couldn't also access in any other way?

It seems to me that if you can access the system clipboard you have enough access to do all sorts of stuff.

Re: How the clipboard works

#48

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…

It's disappointing to see Wayland copied X11's annoying clipboard semantics. I've been using X11 for so long I'm used to it now, kind of, but it still regularly bugs me or leads me to accidentally "lose" some things.

Some time ago I tried to copy something to the X11 clipboard with a Go app, and this is basically impossible as Go can't fork into the background like xclip etc. do, so you need to either depend on a bit of C code or keep the app in the foreground until the selection changes (which isn't really an option for a CLI app).

Re: How the clipboard works

#49

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 absolutely hate select to copy. It mostly ends up with me overwriting the clipboard unintentionally with data I don’t care about. I quite like ctrl-c/ctrl-V (or cmd on a mac). Very easy to use while controlling the mouse with the other hand.

> It mostly ends up with me overwriting the clipboard unintentionally with data I don’t care about.

I mostly find it really useful for "quick copies", like the quote from your post here. I don't really care if it gets overwritten because it's only relevant for a few seconds. For anything else you can still use ^C/^V on Linux.

Re: How the clipboard works

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

Off-topic, but a somewhat similar experience for me was learning about Alt+select. Allows you to select parts of a hyperlink without actually activating the link. (At least in Firefox.)

When you first hear about it, you think "What's the big deal?", but then you quickly find that you use it pretty often.

Post reply on HN