Live data from Hacker News

Don't touch my clipboard

alexanderell.is

141–150 of 322 posts

Re: Don't touch my clipboard

#142
post #99

Earlier quoted context omitted.

Because for some reason terminals are stuck in the 70ies and don't accept those characters as quotes. Anything but ASCII trips them up. Seems such an obvious interface to innovate, but it seems to run into terminal wizards sense of purity.

The problem, such as it is, is with languages. Terminals (mine at least) handle most of Unicode just fine; admittedly I've seen it choke on emoji, but punctuation, nah. The vast majority of programming languages are defined in terms of ASCII and only ASCII. I don't care for this, personally. I've given some thought to how to do quoting right in a programming language, and implemented «guillemets» as an experiment. Bu…

It is a solved problem however. We chose not tot use it (in terminals).

Re: Don't touch my clipboard

#143

Earlier quoted context omitted.

I know they're not compatible with programming languages that you may want to use. But that's the languages' problem. They're perfectly valid, standardised, characters.

No, iBooks inserting them around commands is the problem.

Inserting ASCII quotes instead would result in exactly the same problem.

Re: Don't touch my clipboard

#144

The wrongest thing about this, from my perspective, is that my browser fires off a js 'copy' event when I press control-c. There are times when I've found it helpful that a browser can copy text to my clipboard when I click a button, but I can't think of a single time when I want a site to react to my attempt to copy text off if it. Is there any way to configure my user agent (Firefox) not to do this? A hack is ok.

Under X11, Firefox sets the primary selection correctly and middle-click paste is unaffected. This site also renders fine with JS blocked. That is a useful default to prevent this kind of crap from interfering with you. What is infuriating is CSS that prevents text selection in the first place. That insult to usability should have never been adopted by browsers.

It can be useful. For example I don't want to select the line nunbers next to the code.

Re: Don't touch my clipboard

#145
post #51

It's not just a browser thing. Apple Books does this with their e-books, which is infuriating if you're working with a coding book and just want to copy-paste stuff into your editor/terminal. You get something like: “ghci> putStrLn (pretty 10 value)” Excerpt From: Bryan O’Sullivan, John Goerzen, and Donald Bruce Stewart. “Real World Haskell.” Apple Books. When you only copied: ghci> putStrLn (pretty 10 value) Note th…

I remember that kind of thing as far back as Encarta(?)

Back then, I was writing papers and it was kind of handy.

Re: Don't touch my clipboard

#146
post #62

Earlier quoted context omitted.

I loved it when I used Windows and OneNote (it would add metadata when I pasted to OneNote but not otherwise.)

I think the windows clipboard can hold that as metadata. OneNote had a setting that I could enable so that when I pasted from Edge into OneNote the url was appended, but the url wouldn't show up if I pasted into another rich text editor like Word (or OneNote without the setting enabled). Using org mode now, and there's probably a way to do it with emacs lisp, but... I'll never get around to it.

The Windows clipboard has a model where the clipboard contains an abstract 'data object' which exposes a list of supported formats, then you request formats individually. So a given piece of data could expose (not literally this, but the equivalent) text/plain, text/html, image/png, $my_custom_format and then when an application requests a given format it's generated on demand.

This mostly gets used for scenarios where you're pasting into notepad vs into word - the latter will get rich text if it requests it, while the former is just going to request plain text and get it. When copying text or images or HTML out of typical apps, the clipboard actually ends up having 6 or more different formats in it that all represent the same source content.

The 'generate on demand' means that it's theoretically possible to sync clipboard operations over the network transparently for stuff like Synergy, which is pretty cool - no need to copy that big bitmap over unless software on the other machine actually asks for it. I had some custom clipboard sync software I wrote that did this automatically (with a progress indicator for big data like desktop screenshots) in a couple thousand lines of C# and it was pretty satisfying to use.

Re: Don't touch my clipboard

#147
Just want to share that there's also good reasons for employing this technique.

Eg if you select text in Slack that has emojis or formatting, it tries to put plain-text into the clipboard that would produce said emojis and formatting when pasted back into Slack. This is great, and every chat app does does formatted stuff should do this.

I'd hate it if browser vendors would attempt to block this and as a result, break that kind of functionality too.

Re: Don't touch my clipboard

#148
post #51

It's not just a browser thing. Apple Books does this with their e-books, which is infuriating if you're working with a coding book and just want to copy-paste stuff into your editor/terminal. You get something like: “ghci> putStrLn (pretty 10 value)” Excerpt From: Bryan O’Sullivan, John Goerzen, and Donald Bruce Stewart. “Real World Haskell.” Apple Books. When you only copied: ghci> putStrLn (pretty 10 value) Note th…

> aren't even the ASCII quote character; you get horrid unicode quotes Why should they be ASCII, and what’s wrong with Unicode?

Because the next step when you face this problem is doing a search-replace of the quotes to remove them. ASCII quotes are on your keyboard, so you can actually type the command to remove them.

Unicode quotes probably aren't, so it's extra annoying to remove them, and they're not even the same character for start and end so you have to do it twice.

The time spent for removal is then vastly higher than with ASCII quotes, which in the context of unwanted characters may well qualify as "horrid" imo.

Re: Don't touch my clipboard

#149

Just want to share that there's also good reasons for employing this technique. Eg if you select text in Slack that has emojis or formatting, it tries to put plain-text into the clipboard that would produce said emojis and formatting when pasted back into Slack. This is great, and every chat app does does formatted stuff should do this. I'd hate it if browser vendors would attempt to block this and as a result, break…

Except that your example is only “great” because Slack is reimplementing text input- another thing that maybe should just be handled by the system.

Is it great that Slack also has its own autocorrect and doesn’t know about the system autocorrect?

Re: Don't touch my clipboard

#150
It's fine. This is just stupidity dressed as on-purpose bad UX. Yes, I consider whoever makes that decision ("Yeah, we should totally make it not do what the user wanted it to do!") utterly stupid, and a sad presence in the gene pool.

There are file management apps, graphic design apps (figma), etc., that use both the clipboard and the / binds to work. Neither blocking the bind of events, nor of the clipboard are going to happen.

We all have different needs and different pains. Sure, around here, we care about user experience, privacy, performance and optimizations, but let's not forget that we're in a bubble. The regular less-powered users are just as important as us, and their needs may outweight ours.

I wish there was truly open browser that was not crap, there isn't. I wish better privacy controls were available out-of-the box. I wish there could be a feature matrix backed by a default profile so that I can only give access to the clipboard / other APIs manually, but with a prompt on access attempt. I wish so much.

If I don't like my job runner, or my window manager, or even my password manager, I can go ahead and try with at least moderate success to make my own. Browsers are made by large groups of competent (most of them) polyglots, that work countless hours, willing to drill through the shit that has accumulated over the years into what we call the web. I don't have what's required to make my own browser.

Post reply on HN