I have experienced similar behaviour before, but only now I can reproduce it: Output from a command affecting the text after the next command prompt, ready to be Entered by the user.
Take the following example:
cat /usr/share/terminfo/a/ansi
which has the following effect:
Or, copied and pasted:
1%dP1%dM1%dB1%d@1%dS1%dL1%dD1%dC1%dT1%dA%p1%c2%{1}%-%db%p1%dd
1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m +%d;%dR;0123456789]c1%dm1%dmAX[user@untrusted ~]$ R65;1;9c
As you can see, R65;1;9c
appears after the command prompt and pressing Enter will have it evaluated as command.
I do remember cases where text not only appeared after the command line, but was also executed again, possibly due to it containing newlines.
Can this be considered bug or is this anticipated behaviour, that some kind of combination of non-printable characters allows writing after the next command prompt?