Hacker News new | ask | show | jobs
by kstenerud 1440 days ago
I once watched a coworker do a complete ls -lR of a remote customer system he was working on so that he could copy-paste the listing to a text editor. Unfortunately, he accidentally hit the middle mouse button while he was still over the terminal window. And he was logged in as root.

Every file that had a symlink pointing to it was overwritten (including most of bin and etc and the backup disk which was unmounted at the time). The system was completely broken, and had to be reinstalled from scratch.

1 comments

Default behavior being for a single mouse button to paste and run (if it contains newlines) whatever's on the clipboard always seems dangerous to me. Beyond the accidental mistakes, I bet a website could catch a lot of people out about not checking in a text editor if it presented an innocuous command then swapped it out (with JS or tiny invisible text) for something nefarious when copied.
Many (most?) combinations of a terminal emulator and a shell nowadays won't run pasted content without a further press of the return key.

This is a consequence of "bracketed-paste mode".