Skip to content

Stop RStudio always opening source viewer when in debug mode when evaluating R code #9943

Closed

Description

@jeromyanglim

I posted this question on StackOverview, but it was suggested that this might be a better forum:

I often code functions in the following way by creating a basic function, entering debug mode, and then writing the function in debugmode. E.g.,

myfun <- function(x) print(x)
debugonce(myfun)
myfun("test")

The benefits of this is that I can get real time feedback on whether my code is working with the arguments passed to it.

However RStudio appears to have recently changed its behaviour to make this more difficult. I recently upgraded to 2021.09.0 Build 351.

Previously, it would open the Source Editor when you call this command.
rstudio debug viewer

But if you closed this screen, you could return to your code, edit the code, evaluate code, and so on without the viewer reappearing.
However, now it seems to reappear every time you evaluate your code.
For instance, if I close the viewer, go back to my main script, and evaluate x, the Viewer opens back up.
This is super annoying for someone used to editing and evaluating code while in debugmode using the source script file.

Is there any way of entirely disabling the Source Editor view in Rstudio? Or alternatively, is there a way of being able to edit and evaluate code without the Source Editor constantly re-appearing in Rstudio (like how it used to work)?

Or to phrase as a feature request:

  • Could you restore the previous functionality where the Debug Viewer only opens up once when in debug mode but not on subsequent calls or alternatively could there be a preference to disable the Debug Viewer either completely or only on first call.

My current fix is to downgrade to Version 1.3.1093, where you could edit and evaluate code without the Viewer constantly re-appearing. But it would be a shame to miss out on future upgrades.

Activity

  1. jmcphers commented on Oct 12, 2021

    @jmcphers
    Member

    I think you might be seeing #9918, which was fixed very recently (just last week). Do you observe the same problem in the daily builds?

    https://dailies.rstudio.com/

  2. jeromyanglim commented on Oct 12, 2021

    @jeromyanglim
    Author

    @jmcphers Fantastic! Yep. Installing the daily build fixed the issue.

  3. ldecicco-USGS commented on Oct 19, 2021

    @ldecicco-USGS

    Any idea when this fix is going to make it to an official release? It's painful to do any debugging, and although I have admin privileges to install a daily build, many of my coworkers don't.

  4. slipkid90515 commented on Apr 8, 2022

    @slipkid90515

    Just got a new computer and got RStudio up and running and I am experiencing the same thing. Is there an updated way to resolve this?

  5. kevinushey commented on Apr 11, 2022

    @kevinushey
    Collaborator

    This should already be resolved in the latest release of RStudio (2022.02.1). If you're still having trouble, please file a new issue with more details.

  6. kevinushey commented on Sep 18, 2024

    @kevinushey
    Collaborator

    This behavoir is not fixed!

    Rstudio: 2023.06.2 Build 561 R: 4.3.1

    Why would you make this assertion without actually testing with the latest release of RStudio, or (ideally) a recent daily build as available from https://dailies.rstudio.com/rstudio/kousa-dogwood/?

  7. KasperThystrup commented on Sep 19, 2024

    @KasperThystrup

    Why would you make this assertion without actually testing with the latest release of RStudio, or (ideally) a recent daily build as available from https://dailies.rstudio.com/rstudio/kousa-dogwood/?

    You are right. I had had the issue for a long time, I seached for the wrong thing on Github (and other places), and I even oversaw the fixing issue... So I made the mistake of presuming.. Sorry! :-(

    To prevent confusion I will removed the above message, but keept this for shame :-P

  8. kevinushey commented on Sep 19, 2024

    @kevinushey
    Collaborator

    No worries; I appreciate your taking the time to report + test the latest builds. Sorry for the breakage in the mean time!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions