You joined powershell and R terminal, so the command was sent to powershell. (See the link between R and powershell.) Delete all existed terminals and call a new R terminal can redirect target terminal.
However, even if you do, the triangle (Run Source
button) executes Ctrl+Shift+S
, which will call the source
function and run the entire script. Does default Ctrl+Enter
bother you?
If it is necessary to use the mouse and click to run code, locate the Run Selected Text
option in the ...
button of the terminal (upper right corner).