Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When in debugger, any action in console changes active document #9918

Closed
4 tasks done
hadley opened this issue Oct 5, 2021 · 10 comments
Closed
4 tasks done

When in debugger, any action in console changes active document #9918

hadley opened this issue Oct 5, 2021 · 10 comments

Comments

@hadley
Copy link
Member

@hadley hadley commented Oct 5, 2021

System details

RStudio Edition : Desktop
RStudio Version : 2021.12.0 Build 91
OS Version      : 
R Version       : 

Steps to reproduce the problem

  1. Add the following code to a file, save it, and source it:

    a <- function() b()
    b <- function() c()
    c <- function() {
      x <- 10
      browser()
      x
    }
    a()
  2. Open a new document.

  3. Type 1 in the console and press enter.

  4. The active tab moves away from the new document and back to the source file

Describe the problem in detail

Describe the behavior you expected

Running code in the console shouldn't change the active tab

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@hadley
Copy link
Member Author

@hadley hadley commented Oct 5, 2021

I'm pretty sure this is a reasonable recent regression, and it's super annoying when debugging.

@jmcphers
Copy link
Member

@jmcphers jmcphers commented Oct 5, 2021

The debugger does this intentionally in many cases; e.g. if you use a stepping command then it switches you back to the source window so you can see where the instruction pointer has moved. However, it shouldn't be doing it for any statement you run.

@hadley
Copy link
Member Author

@hadley hadley commented Oct 5, 2021

Ah makes sense!

@valerie-rstudio
Copy link

@valerie-rstudio valerie-rstudio commented Oct 7, 2021

Verified Fixed

RStudio Edition : Desktop
RStudio Version : 2021.12.0-daily+110
OS Version      : mac os 11.5.2
R Version       : 4.1.1

Verified that in the case outlined above, the focus now remains on the new document and does not return to the source file after typing into the console and pressing enter.

@jcrodriguez1989
Copy link

@jcrodriguez1989 jcrodriguez1989 commented Dec 3, 2021

This is also happening in

RStudio Workbench
2021.09.0 Build 351.pro6
© 2009-2021 RStudio, PBC
"Ghost Orchid" Release (50423e45, 2021-09-23) for Ubuntu Bionic
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36

and it is really annoying.
Is there a way of disabling the Source Viewer forever?

Thanks,

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Dec 3, 2021

@jcrodriguez1989; the situation should be improved in the latest daily builds. Would you be willing to test and report back?

@avraam-inside
Copy link

@avraam-inside avraam-inside commented Dec 8, 2021

@ jcrodriguez1989 ; ситуация должна быть улучшена в последних ежедневных сборках . Вы бы хотели протестировать и доложить?

Gentlemens, I use a full-fledged docker layer roker/r studio:4.1.1, respectively, I would like to know when the official release will be released? Because using R with such a debugger is a very big pain(

@slipkid90515
Copy link

@slipkid90515 slipkid90515 commented Apr 8, 2022

Just got a new computer and have been experiencing this same issue. Is there a more formalized workaround besides the daily builds?

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Apr 11, 2022

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

@jgutman
Copy link
Contributor

@jgutman jgutman commented May 10, 2022

For re-testing:

  1. Add the following code to a file, save it, and source it:
a <- function() b()
b <- function() c()
c <- function() {
  x <- 10
  browser()
  x
}
a()
  1. While in the debugger, open a new document.

  2. Type 1 in the console and press enter. The focus should stay on the new document.

  3. Type n in the console and press enter. Since this is a debugger command, the focus should move back to the file containing the function being debugged.

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

No branches or pull requests

10 participants