Paste code in R (connected by ssh)

When using R in local I can copy text from a file directly to the console without problems.

However, when I connect by ssh to another machine and use R, I can not paste fairly large text (4000 characters or more). If the R code I am hitting does not contain text strings (between "" or "'") the problem does not occur, but if it contains them, there comes a time when a line like paste0 ("aa", "bb") breaks , arriving only paste0 ("a From that moment on, all the lines are left out ...

Any ideas?

P.D .: I have tested with several machines, all Linux