←back to thread

217 points tanelpoder | 2 comments | | HN request time: 0.532s | source
Show context
RVuRnvbM2e ◴[] No.26493408[source]
Bash, via GNU Readline, has an option that sidesteps this issue:

  enable-bracketed-paste (On)
       When  set  to On, readline will configure the terminal in a way
       that will enable it to insert each paste into the editing  buf‐
       fer  as a single string of characters, instead of treating each
       character as if it had been read from the keyboard.   This  can
       prevent  pasted  characters  from  being interpreted as editing
       commands.
Effectively it means that even if you paste garbage into the terminal you still have to hit enter before the command is interpreted.
replies(4): >>26494381 #>>26494491 #>>26497760 #>>26500266 #
1. loloquwowndueo ◴[] No.26494381[source]
This won’t help for the kind of clueless blind-paste people who run into this issue in the first place - they don’t know what they are doing, is the actual problem. They’ll just paste whatever, hit enter, and then ask for support because nothing works :)
replies(1): >>26496621 #
2. macintux ◴[] No.26496621[source]
I've been a UNIX admin & developer for 25 years. I still on occasion accidentally paste the wrong text into the terminal.

(Admittedly, I think it only ever happens at home now, because everything I do on a work system scares the hell out of me.)