You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected Closing Parentheses and Braces When Executing Code Chunks in R #1390
Describe the bug
When executing certain chunks of R code using VSCode with the R extension and Radian, I sometimes observe additional closing parentheses or braces being sent to the console, which were not present in the original code. This issue seems to occur after a small delay.
To Reproduce
This issue occurs sporadically and I have been unable to identify a consistent pattern. However, I've noticed that it happens frequently when I run the following chunks of R code multiple times:
Expected behavior
I expect the code to be sent to the console as it is, without any additional characters.
Screenshots
Environment (please complete the following information):
OS: Windows 11
R Version: 4.3.0
VSCode Version: 1.79.2
Radian Version: 0.6.4
Additional context
I noticed that when I format the code differently, the problem does not occur. For instance, the following code does not produce the issue:
I have been aware of this issue for the past two years and have been searching for a solution, as having this problem renders Radian completely unusable. However, I have been unable to find a solution thus far.
Based on the results of my attempts, I have found that this problem is prone to occur when executing lines of code that contain numerous parentheses(for reference only).
I made an example, a formula I scribbled. When I run it slowly, there are no errors. However, when I run it continuously, unexpected brackets appear.
2023-07-07.174752.mp4
When I run a shortened version of the formula, even with a quick click, it runs without errors.
2023-07-07.175159.mp4
Similar error donot occur in R terminal (not radian).
The first one associated with the addition of parentheses or braces when sending a code to the console. It seems as if there is a brief desynchronization when sending the code to the console, and radian tries to close parenthesis before seeing that it was already closed. This can be easily fixed by disabling auto-completion in the .Rprofile or .radian_profile file.
options(radian.auto_match=FALSE)
The second is a bit more problematic and is apparently occurring when the code block is very large, or when a chunk is executed that has several code blocks and these have to be sent all at once to the console. There is a very temporary workaround proposed here that reduces the number of times the problem occurs, although it still happens: Send code to terminal by Ctrl + ENTER but don't run #820 (comment)
@brianmsm There's also, in my experience at least, two new showstopping bugs that started recently: Radian eventually stops printing any output at all, and prior to that it will begin freezing for tens of seconds or more at a time in the middle of executing even a single line of code.
What's interesting to me is all of these feel like regressions. When I first began using VSCode-R with Radian the only issue I had consistently was the buildup of background processes from the language server, and only something as huge as an entire shiny app would fail to auto-execute on ctrl+enter. Both VSCode-R and Radian have steadily gotten less reliable and performant with time.
For example starting an R session with the built in command palette function on an SSH remote is unusable, but calling R at the terminal to create an R session works great.
There's also, in my experience at least, two new showstopping bugs that started recently: Radian eventually stops printing any output at all, and prior to that it will begin freezing for tens of seconds or more at a time in the middle of executing even a single line of code.
New to VSCode-R, and love the idea of it more than the experience at this point. These bugs - persisting even after trying solutions - make Radian completely unusable. Hard to believe these problems have persisted for years apparently.
Reacted by Ben Schneider, D3SL, Dániel Futó, Fred-Wu, Daqian, Fran Barton, Nicholas Van Ryn, Daniel Cooper, Kristopher Nichols, johanOptiply and 4 more
@nicholskl that's a bit over the line. First this is fundamentally a problem with Windows itself, and second VSCode-R is basically a two-man show run by Renkun-ken and Ikuyadeu. And they're fighting an uphill battle against the RStudio monopoly.
Reacted by Daniel Cooper, werkstattcodes, Alberto Fabbri, cramrafalgue, Fred-Wu, Willian Vieira, Victor Navarro, ASN Data Analytics, David Tang, Frederic Denker and 3 more
Activity
LR1933 commentedon Jul 7, 2023
I have been aware of this issue for the past two years and have been searching for a solution, as having this problem renders Radian completely unusable. However, I have been unable to find a solution thus far.
Based on the results of my attempts, I have found that this problem is prone to occur when executing lines of code that contain numerous parentheses(for reference only).
I made an example, a formula I scribbled. When I run it slowly, there are no errors. However, when I run it continuously, unexpected brackets appear.
2023-07-07.174752.mp4
When I run a shortened version of the formula, even with a quick click, it runs without errors.
2023-07-07.175159.mp4
Similar error donot occur in R terminal (not radian).
2023-07-07.180113.mp4
brianmsm commentedon Jul 16, 2023
Well, this seems to be an old and already known problem: #419, #820, randy3k/radian#303, randy3k/radian#277, randy3k/radian#230 . And it is only happening on windows, because Bracketed paste mode is not supported.
The first one associated with the addition of parentheses or braces when sending a code to the console. It seems as if there is a brief desynchronization when sending the code to the console, and radian tries to close parenthesis before seeing that it was already closed. This can be easily fixed by disabling auto-completion in the
.Rprofileor.radian_profilefile.Ctrl + ENTERbut don't run #820 (comment)LR1933 commentedon Jul 19, 2023
I remembered that someone told me this before, but I don't know where "
.radian_profile" is. Can you tell me how to find ".radian_profile", thanks.D3SL commentedon Jul 20, 2023
@brianmsm There's also, in my experience at least, two new showstopping bugs that started recently: Radian eventually stops printing any output at all, and prior to that it will begin freezing for tens of seconds or more at a time in the middle of executing even a single line of code.
What's interesting to me is all of these feel like regressions. When I first began using VSCode-R with Radian the only issue I had consistently was the buildup of background processes from the language server, and only something as huge as an entire shiny app would fail to auto-execute on ctrl+enter. Both VSCode-R and Radian have steadily gotten less reliable and performant with time.
For example starting an R session with the built in command palette function on an SSH remote is unusable, but calling
Rat the terminal to create an R session works great.benz0li commentedon Jul 21, 2023
@D3SL Can you reproduce this on my reference deployment at https://demo.jupyter.b-data.ch?
/usr/local/lib/R/bin/R/usr/local/bin/pythonℹ️ These seem to be Windows specific issues.
nicholskl commentedon Jul 28, 2023
New to VSCode-R, and love the idea of it more than the experience at this point. These bugs - persisting even after trying solutions - make Radian completely unusable. Hard to believe these problems have persisted for years apparently.
thedbcooper commentedon Feb 20, 2024
I am still having this issue using Windows 10. Radian is not usable in its current state for me.
nicholskl commentedon Feb 21, 2024
Unbelievable that this hasn't been fixed or addressed.
D3SL commentedon Feb 21, 2024
@nicholskl that's a bit over the line. First this is fundamentally a problem with Windows itself, and second VSCode-R is basically a two-man show run by Renkun-ken and Ikuyadeu. And they're fighting an uphill battle against the RStudio monopoly.
micdonato commentedon Jun 26, 2025
I have this issue on Mac OS, setting
auto_matchto FALSE in.radian_profileworks (but somehow putting it in.Rprofiledoesn't)eitsupi commentedon Sep 22, 2026
Does this problem still occur if I use arf console instead of radian?
https://github.com/eitsupi/arf
ThomasSoeiro commentedon Sep 26, 2026
@eitsupi @Fred-Wu @grantmcdermott I think we should close this issue as obsolete (like we did for #1090)