Now, first, remember that prex() is unexported precisely because it creates leakage between your current R session and your (re)prex. So in general, prex() users have to take the bad with the good.
But we could try harder to leave certain things the way we found them.
Consider these options, which we inject into to-be-(re)prexed code:
prex() could note the original values of keep.source, rlang_backtrace_on_error_report, and crayon.enabled and make a point of scheduling their restoration.
Now, first, remember that
prex()
is unexported precisely because it creates leakage between your current R session and your (re)prex. So in general,prex()
users have to take the bad with the good.But we could try harder to leave certain things the way we found them.
Consider these options, which we inject into to-be-(re)prexed code:
https://github.com/tidyverse/reprex/blob/318363cf7a911010ebb1593765cc21ec207d2d10/R/reprex_document.R#L131-L141
prex()
could note the original values ofkeep.source
,rlang_backtrace_on_error_report
, andcrayon.enabled
and make a point of scheduling their restoration.