Copy paste shuffles letters in words


I’m doing the Rails Tutorial by Michael Hartl. Today I pasted some code into the terminal.
The following show that the letters in each word are shuffled (not the entire string). A second paste seems to work fine as you can see, but when I hit enter I get a console prompt. Using the up arrow key makes my prompt disappear and previous input overwrites the text. General weird behaviour. Closing the terminal solves the problem but I wanted to document it here for others / support.

:~/workspace/sample_app (modeling-users) airls tste:mdelos bash: reo: command not found <myusername>:~/workspace/sample_app (modeling-users) rails test:models