Skip to content

Radian "works" but won't run my code properly #1090

Closed as not planned
Closed as not planned

Description

@BertrandToulas

When I try to run my code in VS Code via the run button OR ctrl + shift + enter, the radian terminal gives me the following message:

source("c:\\Users\\username\\myfilepath\\...\\file.r", encoding = "UTF-8")
")

If I try several times in a row, it prints out the same thing, but adds more closing parentheses at the end.

On the other hand, if I try to run my code via ctrl + enter (without shift), radian runs only the last line of the code. It doesn't read or recognize anything prior to the last line of my file. For example, I will get an "object not found" error if I create an object on the first line and try to print it on the second. Only if I first highlight all the code and then press ctrl + enter will it print ou the entire selection and the proper result in the radan console.

Here are my JSON settings:

"r.bracketedPaste": true,  
"r.alwaysUseActiveTerminal": true,
"r.rterm.windows": "C:\\Users\\berut\\pyver\\py395\\Scripts\\radian.exe",
"r.plot.useHttpgd": true,
"r.rpath.windows": "C:\\Program Files\\R\\R-4.2.0\\bin\\R.exe",
"r.rterm.option": []

At a complete loss what I'm doing wrong, even after scouring reddit and stackoverflow and youtube...

I'm using the latest versions of VSCode, R, the R extension and R Debugger extension on Windows 11 (not WSL).

Activity

  1. LucasFA commented on May 25, 2022

    @LucasFA
    Contributor

    In case you're interested in a temporary solution, you should know that you should be able to delete the ") at the end. Doing so and pressing enter will send the rest of the command to the terminal.

    If this happens everytime it will get annoying, though, so you have have found you prefer Ctrl + A, Ctrl + Enter, though the output is difficult to read with all the intertwined code in the terminal.

    Also, Ctrl + Enter and Ctrl + Shift + Enter do very different things. The latter executes the whole active document file (by sending a source(...) call inside R, while the former just sends the current line of text to the terminal.

    Does this bug appear very often for you, or can you reliably reproduce it? I have previously encountered the behaviour but I can't reproduce it so never bothered to raise an issue.

  2. natereal commented on Jul 4, 2022

    @natereal

    I am also having this issue. I cannot reproduce it reliably, but it breaks my work flow to the point that VS Code is barely use-able.

  3. D3SL commented on Oct 9, 2022

    @D3SL

    There's a partial fix here in #820. It solves the duplicated brackets/quotes/parens issue but it doesn't solve the problem of code not actually being run when you use ctrl+enter, at least for me. It's still a substantial QOL improvement though to not have typos forced into the code constantly.

  4. bschneidr commented on Jun 16, 2023

    @bschneidr

    I have this typo constantly. I assumed it was just related to UNC paths on my Windows machine. But good to know others experience it too. It drives me crazy and is a big factor why I use RStudio more than VS Code for my R development.

  5. benz0li commented on Jul 10, 2023

    @benz0li
    Contributor

    See also issue #1390.

  6. github-actions commented on Jul 10, 2024

    @github-actions

    This issue is stale because it has been open for 365 days with no activity.

  7. ThomasSoeiro commented on Sep 22, 2026

    @ThomasSoeiro
    Collaborator

    @Fred-Wu @eitsupi @grantmcdermott Close as obsolete/duplicate of #1390?

  8. eitsupi commented on Sep 22, 2026

    @eitsupi
    Member

    This is outdated, so I'm closing it.
    Please let me know if you continue to experience problems.

    ...and, please try arf console instead of radian.
    https://github.com/eitsupi/arf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions