radian
radian copied to clipboard
execute multiline selection in active [radian] terminal fails in vscode
environment:
R 4.1.1 (linux) vscode 1.62.1 vscode settings:
// Use active terminal for all commands, rather than creating a new R terminal.
"r.alwaysUseActiveTerminal": false,
not working:
Selecting the following and hitting <ctrl+enter> tries to execute but fails with error:
library("pasilla")
pasCts <- system.file("extdata",
"pasilla_gene_counts.tsv",
package="pasilla", mustWork=TRUE)
output:
r$> dds <- DESeqDataSetFromMatrix(countData = cts,)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'nrow': argument "colData" is missing, with no default
r$> colData = coldata,
Error: unexpected ',' in " colData = coldata,"
r$> design = ~ condition)
Error: unexpected ')' in " design = ~ condition)"
working:
after reformatting the statement as a single line, it succeeds (using same keystrokes as above):
pasCts <- system.file("extdata","pasilla_gene_counts.tsv",package="pasilla", mustWork=TRUE)
file.exists(pasCts)
output:
r$> file.exists(pasCts)
[1] TRUE
It seems to be a vscode specific issue.
Same here. Has this issue been solved? Thanks!
Or does anybody know any turnaround?
@yanhao-wang Try to enable "R: Bracketed Paste"-mode in settings.
@yanhao-wang Try to enable "R: Bracketed Paste"-mode in settings.
This fixed it for me, thank you.
Ok, just trying to drop more keywords in this issue thread so that I and others might find it faster next time: we were wondering whether this was due to CRLF or LF line endings on a WSL2/devcontainer setup running an Ubuntu as guest. We then set up a pure Ubuntu machine and the issue persisted with CR apparently being inserted after every line. We could not reproduce the issue on vanilla R, so it seems specific to radian.
I suggest this issue be closed 🙂
Long story short, it is not due to the newline char. It is due to the fact that Microsoft terminal didn't support bracketed paste mode. PS: Not sure the current status.
I'm having this same issue except with sublime text and sending code to terminus. It works fine when I use R without radian. Does anyone have any ideas how to solve this?
I am having a similar issue only with going from RStudio to a terminal with Radian. Would love for there to be a solution for it. I really love using radian for all of its other features, but this becomes a workflow killer at times.
I'm having this same issue except with sublime text and sending code to terminus. It works fine when I use R without radian. Does anyone have any ideas how to solve this?
Based on a comment by @mkhq above https://github.com/randy3k/radian/issues/320#issuecomment-1125059020, I was able to solve the issue in Sublime Text by changing the SendCode settings file (Preferences -> .Package Settings -> SendCode -> Settings)
In the default settings file:
"r" : {
"prog": "tmux",
// turn bracketed_paste_mode on if radian or readline 7.0 is in use
"bracketed_paste_mode": false
}
Changed to:
"r":
{
"bracketed_paste_mode": true,
"prog": "terminus",
}