Live data from Hacker News

Don't Copy-Paste from Website to Terminal

thejh.net

171–180 of 272 posts

Re: Don't Copy-Paste from Website to Terminal

#172
post #162

Earlier quoted context omitted.

Yeah, I didn't consider the fact that not everyone has sl on their machine.

It is a sad world we live in where some people don't have sl installed.

sl is horrible - I don't need to waste however many seconds just because I mistyped something.

Re: Don't Copy-Paste from Website to Terminal

#173

Earlier quoted context omitted.

Problem is , as far as the browser knows you meant to copy the whole thing. If you look at the source the actual text of that paragraph is what gets copied, they just use some sneaky CSS to make it not visible. It's not explicitly marked as hidden.

In this particular case, the characters that get copied are clearly rendered far outside of the area selected by the mouse (in fact, outside the visible area), so I don't see a reason why the browser should think I meant to copy them. Yes, it's probably not easy to fix, and once fixed there are probably a dozen different ways of cheating. I'm just pointing out that it's certainly possible to fix this particular attac…

I often copy things away from my mouse. Consider hitting control-a, or grabbing a region with the mouse and then expanding it with some keyboard navigation. It's very much a non-trivial problem.

Re: Don't Copy-Paste from Website to Terminal

#174

Earlier quoted context omitted.

I was quite surprised when this was the normal way of installing rvm: https://rvm.io/rvm/install/

Hence why many use rbenv instead. https://github.com/sstephenson/rbenv/#neckbeard-configuratio... https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F

For me, the method of installation is one of the less important reasons why I started using rbenv instead of rvm. rbenv's simplicity and speed appealed to me, and the trigger for switching was rvm destroying itself again (or otherwise rendering itself unusable) after updating it.

Re: Don't Copy-Paste from Website to Terminal

#176

Earlier quoted context omitted.

I dislike this whole trend. How about we start thinking in terms of leaving the user's default environment, and system, alone, and “installing” software into nice sandboxed areas where we can easily enable/disable it, or delete it with a simple “rm -rf directory/path”

To be fair to Homebrew (the example I'm picking on here), it does install to a nice sandboxed area. That area is named "/usr/local", but you can give it its own path and everything works pretty well. (I find I have to completely remove and reinstall Homebrew about every two months, generally because libgettext changed yet again.)

Homebrew is ok, and it has arguably improved the situation on Mac OS X a great deal, but I think we can do better still.

Using homebrew, one tweaks recipes in ruby code until they work.

Why do we not have a common (and widely adopted!) way for software projects to tell other software how to install/uninstall them, and what other projects they depend on for what particular operations (e.g. configure, build, install, test etc), with reusable data rather than code.

Why is (some of) this information captured in bits of ruby, useful for a particular OS X package management system, but not when you want to deploy a similar stack to a IaaS provider where you'll use a different incompatible system like Puppet or Chef to set up the same stuff.

I think we have made this whole situation more complicated and fractured than it needs to be.

Re: Don't Copy-Paste from Website to Terminal

#178

Bash and Zsh provide shortcuts to open a text editor where commands can be pasted and edited before running (Ctrl-x Ctrl-e in bash, need to enable in zsh [2]). I've been using this on Linux not for security but because I'm still confused by X11's primary and clipboard selections [1]. It seems like every time I try to paste a github repo link, I get the last chunk of code I copied and vice versa. [1] http://www.nongnu…

Every once in a while I think I have my shell environment set up exactly the way I want it. Then I find out about something like this - thanks for the tip.

Re: Don't Copy-Paste from Website to Terminal

#179
Good terminal emulators (xterm, urxvt, iTerm2, etc.) have support for "bracketed paste mode" which can be used to fix this problem in zsh: https://github.com/robbyrussell/oh-my-zsh/pull/1698 (original code: http://www.zsh.org/mla/users/2011/msg00367.html)

It's probably easy to write a similar fix for bash.

Post reply on HN