Shell – Why is Terminal automatically executing the command after pasting text

clipboardcommand lineshell

This happens whether I use ctrl+shift+v or paste from the right-click menu.

What could be done to prevent this behavior?

Best Answer

Don't copy multiple lines of text, to paste. I can almost guarantee you're simply copying the last part of the line. If you're triple clicking to copy that line of code you're pasting, you're getting the newline at the end of the line. If you want to be sure, that is really the problem, then copy the entire line, except for the last letter/digit, and see if pasting that also includes a newline.

Related Question