9 ms·
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 s
by stefco_ 7y ago
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 that the quotes around your actual selection aren't even the ASCII quote character; you get horrid unicode quotes that are easy to miss if you're just trying to run a bit of code in your REPL. This isn't even a DRM ebook, so it's not like Apple is being compelled by contract to insert a citation. It's awful, user-hostile behavior that removes one of the main advantages of digital-vs-hardcopy coding books (copy/paste), and AFAIK there's no config that lets you disable it.
- jsmith99 7y agoOn Windows, clipboard items have hidden tags added when they are copied, so the program you are pasting into can make these decisions, instead of the program you are copying from needing to manipulate the copied text. For example, if I copied that code from a Web page and pasted it into the console it would paste just the code, but if I pasted it into Onenote it would check the tags and add a line underneath with the url the code was copied from. https://devblogs.microsoft.com/oldnewthing/20140721-00/?p=453 https://devblogs.microsoft.com/oldnewthing/20140721-00/?p=45...
- roryokane 7y agoDon’t despair, there are workarounds for this. See the many answers to https://apple.stackexchange.com/q/137047/21473 https://apple.stackexchange.com/q/137047/21473 ‘Don't want iBooks to always paste the “Excerpt From” of what I have copied’. I recommend the solution in https://apple.stackexchange.com/a/382603/21473 https://apple.stackexchange.com/a/382603/21473 (which is an improved variant of stassats’s solution in https://news.ycombinator.com/item?id=22355322 https://news.ycombinator.com/item?id=22355322). The method is to use Automator to set up a Quick Action that copies the text while bypassing the clipboard-modifying behavior of Books. Then you configure a keyboard shortcut of ⌘C for the Quick Action, only in the Books app, so you don’t have to change the way you copy.
- belltaco 7y agoWonder if an author will rename themself sudo rm -rf / with the proper escape codes.
- dan_hawkins 7y ago`rm -rf ~` is disastrous enough on macOS with a bonus of not having to authentiacate sudo.
- diegoperini 7y agoHow 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?
- dan_hawkins 7y agoI'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.
- mercer 7y ago> Time Machine helped me quite a lot but unfortunately with a nasty surprise that it doesn't backup dot files. Wow, that's good to know!
- dan_hawkins 7y agoPS: it turns out you can restore dot files from the Time Machine backups but it's not enabled by default: https://apple.stackexchange.com/questions/141321/how-to-restore-a-hidden-file-in-time-machine#141322 https://apple.stackexchange.com/questions/141321/how-to-rest...
- nneonneo 7y agoIt also messes with dictionary lookup! It adds this nonsense if you select more than two Chinese characters, and so it makes it really hard to look up four-character Chinese idioms in my dictionary (which are, inexplicably, frequently missing from the built-in “lookup” dictionary). Apple Books is so close to being a nice reading interface, but there are so many stupid little bugs. Highlighting is another horrid little bug that can easily wipe out a full chapter’s worth of highlights with one tap...
- greggman3 7y agoThe entire Apple dictionary system is a PoS AFAICT. It only works with perfect spelling and it only works with single words. How about finding closest match and how about letting me select lots of text and go through all the words. I can only guess no one on the team actual uses the feature. As a language learner I use Rikaikun for Japanese on my desktop browser. While I'd really like it if I could also run a similar extension in my mobile browser I'd be okay of Apple's dictionary actually worked with a fuzzy search and multiple terms... but no....
- brokenmachine 7y agoWhat a surprise that Apple would do something user-hostile.
- jariel 7y agoMy instinct is that this is for legal attribution purposes, i.e. a legal moat. It sounds ridiculous, but in my experience, there are 1000 things that lawyers will identify as possible sources for legal trolling and this looks like that. Apple has a zillion dollars in the bank and they are sued daily. All it takes is for a judge who may nor not be knowledgable or a sufficiently grey area ... and you have a major problem. So it could be risk mitigation: they are including the attribution in the copy so as to not be perceived as partisan to some kind of IP dissolution paradigm. On the other hand, this could just be one of those wayward culty Apple kinds of things they think is 'good UI' when it's not.
- otterley 7y agoUnlikely - see my comment elsewhere in this post.
- jariel 7y agoSo yes, I see in your comment that given the context of 'Apple Books' it's probably a contractual issue, I agree there. Though I can see that a reasonable legal opinion might not support my more cynical view, when the risk dynamics are high, a different kind of logic creeps in. I worked for a software platform that refused to provide usable snippets of code anywhere in the documentation for fear of liability. We also 'perpetually sued' an organization that was infringing on our brand, even though they were really helpful to us (a user-managed fan-site which used our name in theirs) and otherwise had a positive relationship with them. Our 'perpetual legal action' was merely cover give the appearance that our brand was being defended, without which action, we could feasibly lose rights to it. So, literally suing people, while dragging out and 'nudge-nudge-winking them' to not worry about it, literally inviting the people we were suing to events, dinners etc.. I don't think most people understand the risk dynamic in many large organizations with respect to these issues, the calculation seems bizarre even to most regular product types, it really takes a legal view to understand this. And also the personal fears and biases of the executives.
- AndrewStephens 7y ago
- ComputerGuru 7y agoIf your shell has a function for copy and paste integration (like fish), just override it with a sed script to remove that crap. Same for vim’s clipboard integration.
- chrisseaton 7y ago> aren't even the ASCII quote character; you get horrid unicode quotes Why should they be ASCII, and what’s wrong with Unicode?
- Osiris 7y agoI think they are talking a about styled quotes, the kinds that point inward, which a REPL won't interpret as an ASCII quote and will throw some type of Syntax error.
- chrisseaton 7y agoOk but those are standard, valid characters like any others. Why are they ‘horrid’?
- tedunangst 7y agoBecause they result in a syntax error.
- chrisseaton 7y agoBut they wouldn’t do what you wanted anyway if they were ASCII. What’s the problem specifically with them being Unicode?
- nitrogen 7y agoThe problem specifically is that they are not the ASCII quote character. There is only one ASCII quote character, and that's the one used by programming languages. Any other quote or quote-like character is outside the ASCII range, and must therefore be Unicode (or another non-ASCII code page).
- chrisseaton 7y agoI 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.
- kkaranth 7y agoI hate this behavior! Switched to a different eBook reader on my iPad because of it. I like copying interesting snippets to OneNote.
- mitch-snipline 7y agoOut of interest what did you choose? I'd love something different that syncs between MacOS and iPad for ePub files.
- paulddraper 7y agoI remember that kind of thing as far back as Encarta(?) Back then, I was writing papers and it was kind of handy.
- ygra 7y agoOneNote does this on the paste end, which is really nice for collecting references and quotes, as you get the source automatically.
- Fnoord 7y agoIs this not a setting you can put off? I would say it is a reasonable function if it can be toggled on/off (I would prefer default off, YMMV).
- stassats 7y agoI solved the Apple Books problem with an automator script, using the "Copy to Clipboard" action. Then it can be assigned a shortcut in Keyboard preferences. https://imgur.com/a/sG2isap https://imgur.com/a/sG2isap
- paxdoxemus 7y agoThis was really helpful, thanks for sharing!
- roryokane 7y agoThanks for the method. I’ve written up detailed instructions for it at https://apple.stackexchange.com/a/382603/21473 https://apple.stackexchange.com/a/382603/21473. As you can see in that answer, I found a better method to assign the keyboard shortcut. Assigning the shortcut within App Shortcuts instead of Services lets you use the normal ⌘C shortcut in Books while not affecting copying in other apps.
- stassats 7y agoLimiting the action to "Books" seems to not affect other apps as well. The main reason I did not use ⌘C is because it doesn't work when the context menu is displayed (and it gets displayed immediately after selecting text).
- thanhkitt 7y ago“ghci> putStrLn (pretty 10 value)” Excerpt From: Bryan O’Sullivan,
- rogual 7y agoApple Books has so many of these ridiculous little incursions against good taste. Just to vent, I made a list of all the ones I found: http://macos-design-review.com/books.html http://macos-design-review.com/books.html It really does seem like software at Apple is being designed by people who just aren't familiar with the platform.