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
calling handlers from .Rprofile don't persist in session #6892
Ark currently does its own execution of .Rprofile after startup instead of letting R take care of running it. This helps address a number of startup issues but also results in a few behavioral differences (see also #6344, #6417).
My guess is that to resolve this issue we'll need to do some fancy footwork to evaluate .Rprofile at the top level instead of executing it inside a nested/source context.
We have our own globalCallingHandlers() for error - that's how we can display errors in a custom way in the Positron console (i.e. with collapsible traceback and what not).
That said, we tried to be somewhat careful about this. If I do as you say and run globalCallingHandlers() in the console, i see both your handler and our handler on the "stack" of handlers and it does like like yours is first (meaning it should run first, then let ours run).
It seems to work correctly when globalCallingHandlers(error = function(e) stop("Caught that!")) is called directly in the console but not when its set from the Rprofile even though both situations "look" the same when you print globalCallingHandlers(), weird.
I reported a duplicate version of this y'day in #9480. It's a blocker for setting progressr::handlers(global = TRUE) in Rprofile, which registers a global calling handler. As shown in #9480, a manual workaround is to re-register the calling handlers at the prompt:
Activity
jmcphers commentedon Mar 20, 2025
Ark currently does its own execution of
.Rprofileafter startup instead of letting R take care of running it. This helps address a number of startup issues but also results in a few behavioral differences (see also #6344, #6417).My guess is that to resolve this issue we'll need to do some fancy footwork to evaluate
.Rprofileat the top level instead of executing it inside a nested/source context.DavisVaughan commentedon Mar 20, 2025
We have our own
globalCallingHandlers()forerror- that's how we can display errors in a custom way in the Positron console (i.e. with collapsible traceback and what not).That said, we tried to be somewhat careful about this. If I do as you say and run
globalCallingHandlers()in the console, i see both your handler and our handler on the "stack" of handlers and it does like like yours is first (meaning it should run first, then let ours run).It seems to work correctly when
globalCallingHandlers(error = function(e) stop("Caught that!"))is called directly in the console but not when its set from the Rprofile even though both situations "look" the same when you printglobalCallingHandlers(), weird.HenrikBengtsson commentedon Sep 19, 2025
I reported a duplicate version of this y'day in #9480. It's a blocker for setting
progressr::handlers(global = TRUE)in Rprofile, which registers a global calling handler. As shown in #9480, a manual workaround is to re-register the calling handlers at the prompt:globalCallingHandlers(globalCallingHandlers(NULL))HenrikBengtsson commentedon Oct 9, 2026
Has there been any progress on this?