While not a solution, there is a work-a-round to this annoying issue for those pasting code into macOS Terminal. Using iTerm2 instead of Terminal, you'll be prompted to Paste Without Newline. Not ideal having to use one program to overcome the shortcomings of another, but it gets the job done.
[Bug Report] - Copying text from Evernote app (Mac) adds newline
in Evernote for Mac Requests (Versions 7.14 and under)
Posted
While not a solution, there is a work-a-round to this annoying issue for those pasting code into macOS Terminal. Using iTerm2 instead of Terminal, you'll be prompted to Paste Without Newline. Not ideal having to use one program to overcome the shortcomings of another, but it gets the job done.