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
Environment pane keeps a callback's debug frame after browser() returns inside an idle-loop callback #19259
The environment module decides whether the Environment pane shows a debug frame in its console prompt hook (SessionEnvironment.cpp, onConsolePrompt): on each REPL prompt it checks r::session::isBrowseActive() and the context stack, and switches the monitored environment between the browser frame and the global environment.
When browser() is entered from code R runs from the idle event loop (a later::later() callback), and the user continues until the callback returns, R is back inside the top-level console read that was already waiting. No new top-level read happens, so no REPL prompt fires, and the pane keeps showing the callback's frame until the next console command.
#19237 reissues the top-level prompt to the client when such a callback returns and restores R's own top-level, executing and browser-active flags, but a reissued prompt deliberately runs no module prompt hook (that hook marks the REPL done evaluating input, and the notebook queue finishes a chunk on it), so the environment module's debugger state is not reset.
Proposed fix
A narrow module-level notification for "the console is back at its top-level read with nothing pending", distinct from the REPL prompt hook, fired where #19237 reissues the prompt. The environment module would reset its debugger state on it (the *pContextDepth > 0 && !browserActive branch of onConsolePrompt), and the Environment pane would follow the console. Other consumers that only need "R is idle at the prompt again" could move to it as well.
Activity
clear the browser-active mark a handler's browser() left behind
keep serving requests while r runs code from the idle event loop (#19237