Skip to content

PR1706 follow-ups#1716

Merged
renkun-ken merged 2 commits into
REditorSupport:masterfrom
grantmcdermott:pr1706-follow-ups
Jun 30, 2026
Merged

PR1706 follow-ups#1716
renkun-ken merged 2 commits into
REditorSupport:masterfrom
grantmcdermott:pr1706-follow-ups

Conversation

@grantmcdermott

Copy link
Copy Markdown
Contributor

Two minor follow-ups to #1706:

  1. Don't leak plot_backend into global R environment (H/T @Fred-Wu comment)
  2. Warn user if a requested plot backend is not installed. (H/T @chmzs comment)

profile.R is sourced as the user's R_PROFILE_USER, so the top-level
plot_backend assignment created a stray variable in the user's global
environment that persisted after startup (reported by @Fred-Wu).

Wrap the sess::connect() setup in local() so the temporary plot_backend
binding stays scoped, matching the pattern used by the .Rprofile block
above it.
When r.plot.backend explicitly selects jgd or httpgd (or the legacy
r.plot.useHttpgd is true) but the package is not installed, register_hooks
silently fell back to the standard viewer. The standard viewer has no
plot-cycling UI, so users saw a degraded experience with no explanation
(several reports on REditorSupport#1706).

Emit a warning from register_hooks naming the requested backend and the
remedy, but only when a specific backend was explicitly requested. The
auto mode (use_jgd && use_httpgd) still degrades silently by design.

@renkun-ken renkun-ken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@renkun-ken renkun-ken merged commit c02ace5 into REditorSupport:master Jun 30, 2026
5 checks passed
@grantmcdermott grantmcdermott deleted the pr1706-follow-ups branch June 30, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants