Unable to quit debug/browser mode

17,559

The problem is that as soon as you leave debug mode, something is triggering a call to ls, which puts you back in debug mode. To fix the issue, turn off debugging for ls before you leave the debugger:

Browse[2]> undebug(ls)
Browse[2]> Q

Consider using debugonce rather than debug to avoid getting into these kinds of loops.

Share:
17,559

Related videos on Youtube

angli
Author by

angli

Updated on September 16, 2022

Comments

  • angli
    angli over 1 year

    In Rstudio console, I ran the following commands

    > debug(ls)
    > ls()
    

    Then, I could not quit/leave the debug mode. I tried the following:

    1, "Q" + "enter key" 2, "c" + "enter key" 3. the red "Stop" button.

    but it does not leave debug mode.


    Browse[2]> Q
    debugging in: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
    debug: {
        if (!missing(name)) {
    

    Error: unable to quit when browser is active
    Browse[2]> c
    exiting from: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
    debugging in: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
    debug: {
        if (!missing(name)) {
    

    .....


    The Rstudio version: Version 0.98.1060 – © 2009-2013 RStudio, Inc.

    The R version: R i386.3.1.1

    Has anyone had this issue in Rstudio? Thanks. Ang