Live data from Hacker News

Don't touch my clipboard

alexanderell.is

301–310 of 322 posts

Re: Don't touch my clipboard

#301
post #234

Earlier quoted context omitted.

> and a few helper function that normalize it into ASCII and so on If you are going to get rid of it anyways, why bother with it in the first place? Also, you then have the ambiguity/problem whether some symbols are mapped to the same ones or not. > already know how to deal with it without ambiguity I wish. Just dealing with ü vs ue vs \"u and ascii, win something, utf8 and utf16 is still annoying in practice. Or lat…

The argument to do it is it democratizes users with their scripts around the world (and solve the issue of having 'the wrong' quote). Normalization solves the latter. It's really solved, but you would never know if you live exclusively on the command line. Which I think is unfortunate.

I disagree, it simply tells everyone they are wrong and the "normalized" one is the right one.

Oh, you used foo and föö as variable names, too bad those are the same now by normalization.

> It's really solved, but you would never know if you live exclusively on the command line. Which I think is unfortunate.

Tone down the condescension and insults, please.

Re: Don't touch my clipboard

#302

Earlier quoted context omitted.

`rm -rf ~` is disastrous enough on macOS with a bonus of not having to authentiacate sudo.

How do people know the result of running this command without running a VM? Is it possible to run OS X in a VM these days? The command's intention is so obvious I wonder why there is no warning from the os, the shell program or the terminal for such, easily blacklist-able commands. Or is there?

I've learned that personally one night fighting messed up rebase conflicts and for still unknown reason I copied and pasted a path for `rm` and ended up issuing `rm -rf ~ /repo-path /unneeeded-dir` - it took me a couple of seconds to realize that this command takes unexpected long time to execute and then my eye caught a view of Finder window with shrinking list of folders in home directory :) Time Machine helped me quite a lot but unfortunately with a nasty surprise that it doesn't backup dot files :-/ Lessons learned.

Re: Don't touch my clipboard

#304

Earlier quoted context omitted.

How would you institute that in the clipboard logic and independently of the app? Because we're no longer operating in a world in which apps or processes are trusted or trustable. Maybe the ones you write, maybe if you're really lucky the ones that come with your fully-vetted Linux distro. But not npm installs, not proprietary binaries, not website logic, and most especially not the crap that's distributed on mobile…

The clipboard can’t tell whether the content is “right” nor can the copying be done by the OS/clipboard itself. In general the application is the only thing that knows what is selected (e.g objects in a cad program) and the OS has no idea of how to serialize these into the clipboard. Even a text editor has to tell the OS what is selected and the OS can only trust the app to tell the truth. The only way to “verify it”…

This is getting beyond my paygrade, though it in part depends on the OS dispaly system.

There are some concepts -- and I very barely grasp this -- such as Display Postscript, not in present use AFAIU, which might offer such capabilities within the windowing system.

That is, with DPS the display itself would have awareness of both the underlying text and the formatting directives.

Whether that's even remotely similar to existing graphical systems, I've no idea.

See: https://en.wikipedia.org/wiki/Display_PostScript

Re: Don't touch my clipboard

#305

Earlier quoted context omitted.

Modern versions of rm require you to pass --no-preserve-root. According to Wikipedia [1] this has been the default (in upstream) since 2006. Of course it took distros some time to actually update to the GNU utils 6.4 (especially long-term support systems like CentOS) but it's been a decade since the change should've been implemented everywhere. [1]: https://en.wikipedia.org/wiki/Rm_%28Unix%29#Protection_of_th...

worth noting that it can be trivially workarounded by adding an asterisk at the end: `rm -rf /*` still works.

That version will helpfully leave behind any .files lingering in /

Re: Don't touch my clipboard

#306

Earlier quoted context omitted.

Here's a stab at defining a function: The clipboard should act at an only at user direction to copy content from one application or context to another. The clipboard should not, nor should applications be able to, alter the copied content from the visibly-selected content. Applications, other than when clearly and unambiguously directed by the user be able to access or read clipboard contents. I'd suggest additionall…

> The clipboard should not, nor should applications be able to, alter the copied content from the visibly-selected content. This might feel intuitively right, but it severly limits the usefulness of the clipboard. It then becomes a basic plain text clipboard Try opening an rich text editor (e.g. https://quilljs.com/playground/ ) and selecting two words of which one is bold. Hit Ctrl+C. What is now on the clipboard? W…

Interestingly, I can copy text from Pages to Word and the formatting is (somehow) preserved, even though this version of Word predates Pages by a few years.

Perhaps the clipboard contents are somehow tagged with their source so the destination can do something intelligent with its contents? This would potentially provide another way to lock down the clipboard: fishy photo filter can get access to an image on the clipboard (or maybe only images from certain sources), but not text.

Re: Don't touch my clipboard

#307

Earlier quoted context omitted.

- This bathtub has a hole in it - Just throw it and the baby away, problem solved

It's not the first time this would be required and done. You probably remember Flash. Once Flash was kicked out Javascript took over it's duties. Only you can't just simply block all JS or expect sites to work without it. JS is worse than Flash now.

And it's probably going to get worse with wasm + canvas.

Re: Don't touch my clipboard

#308

Earlier quoted context omitted.

The clipboard can’t tell whether the content is “right” nor can the copying be done by the OS/clipboard itself. In general the application is the only thing that knows what is selected (e.g objects in a cad program) and the OS has no idea of how to serialize these into the clipboard. Even a text editor has to tell the OS what is selected and the OS can only trust the app to tell the truth. The only way to “verify it”…

This is getting beyond my paygrade, though it in part depends on the OS dispaly system. There are some concepts -- and I very barely grasp this -- such as Display Postscript, not in present use AFAIU, which might offer such capabilities within the windowing system. That is, with DPS the display itself would have awareness of both the underlying text and the formatting directives. Whether that's even remotely similar…

In the most general case (and more commonly than it ever was) each app is just a rectangular area where it renders using gpu hardware with. This used to be how games rendered but now even shells and text editors are getting there. If one has to manage this case too then basically the only places one can copy from are in the compositor (images ie screenshots) or from apps. Even when text drawing is passed through the OS (or platform libs e.g GDI on windows) it’s difficult to imagine APIs where the OS would know what is “selected”, ie what should be passed to the clipboard.

Re: Don't touch my clipboard

#309

Earlier quoted context omitted.

Here, paste this into your terminal: echo "hello" echo "lol" ; sudo sl -rf / (In case it's not obvious, the # trick will not help you.)

So... don’t paste it in my terminal?

heh, yes. Admittedly, immediately after posting, I did change it from 'rm', which would not be a good idea to run, to 'sl', which ... well, try it (or `man sl`), it's fun.

Re: Don't touch my clipboard

#310
post #257
post #229

Earlier quoted context omitted.

Order does not matter with compose, that also makes it more user friendly than dead keys. The modifiers' proper names are "ring above" and "breve".

Whoa, thanks! I've used the compose key for a long time (I'm an amateur Polish speaker who also occasionally writes French) and I never realized it was order-insensitive!

It's oder-sensitive under X11 but many of the the default combinations are duplicated with the reverse order.
Post reply on HN