Live data from Hacker News

How the clipboard works

whynothugo.nl

1–10 of 160 posts

Re: How the clipboard works

#2
> The majority of the implementations out there are broken and only handle text.

Copy/paste are the biggest neglected operations in computing, considering that they are the only universal mechanism for transferring data between applications that is accessible to end users.

Mobile intents do help somehow, but they are not universal or available on desktop or web environments.

Re: How the clipboard works

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

Re: How the clipboard works

#4

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.

I know in Word and maybe other MS products you usually get an option of

* keep source formatting

* match destination formatting

* text only

Re: How the clipboard works

#6

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.

I know in Word and maybe other MS products you usually get an option of * keep source formatting * match destination formatting * text only

Exactly, but the implementation is nontrivial/nonobvious if I'm copying from the web for example.

Re: How the clipboard works

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

Re: How the clipboard works

#9
The "closing the app after copying and before pasting" case is very interesting. Shows how even things that sound simple turn out to have very tricky edge cases as soon as you start optimizing and really thinking about how to implement them.

The clipboard manager solution seems okay, but copying everything immediately seems like it defeats a lot of the elegance of the design. Perhaps it'd be preferable if the original program held the clipboard until it was about to exit, at which point it would issue a "last call" sort of announcement so that a clipboard manager could optionally "take over" the clipboard. But that wouldn't capture crashes or any app that doesn't send such a signal, so perhaps the aggressive copying is more thorough. But if that's desirable, maybe always copying data to the window manager is the better choice. Presumably Windows is doing this?

Re: How the clipboard works

#10
This design could have an interesting security twist to it. The copy side could maybe infer who the paste side is and change the output, similar to the problems of piping curl into bash.
Post reply on HN