Hacker News new | past | comments | ask | show | jobs | submit login

zsh actually detects pastes into the terminal and doesn't submit the commands on newlines. This way you see the full command and have to hit enter yourself to run it.

It isn't perfect because people could try to obscure the command but in general it makes me a lot happier to paste commands into my terminal.




This. I'd argue that the issue here is more with terminals and shells than web browsers: paste shouldn't immediately start executing something. The technology to not do so has been around for years - it's called bracketed paste: https://cirw.in/blog/bracketed-paste


I must be doing something wrong, because I copy and paste multiple lines all the time into zsh (ohmyzsh on iTerm) and it will execute all but the last line (which generally doesn't have a new line on it)


Maybe your terminal doesn't indicate pasted content properly. I'm using gnome-terminal and it works flawlessly.


This was one of the first things that made me fall in love with zsh.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: