Sometimes on rstudio server, I'm logged in on an another server via the terminal (or in R inside a docker container).
Would be great to be able to do CTRL+SHIFT+ENTER or something to send script content to the terminal (rather than the console). (Also would help a lot when using RStudio's shell editing functionality)
rstudioapi package has functions to interact with the terminal (such as terminalSend). Could you use it to create a simple RStudio add-on or a Shiny gadget to do what you want? You can even automate the whole process of opening the ssh connection and launching R in the terminal.