VS code mangles command when sending selection to R

Viewed 82

When I open a .R file and highlight a line and press Shift + Enter, VS code sends the line to R, but it mangles the text. For example, if I try to run

library(data.table)

Here is what I get back from R:

> 00~library(data.table)01~
Error: unexpected numeric constant in "00~library(data.table)01"

Strangest thing. VS Code works fine for me for Go, Typescript, Haskell, Python, but it doesn't like R. Any suggestions?

1 Answers

It looks like bracketed paste mode is on. Try adding this to your settings.json:

"r.bracketedPaste": false

Bracketed paste mode should usually be on if using the radian console but off if using the standard R console.

Related