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
[Bug]: view button sends explicit .GlobalEnv lookup to terminal instead of View() only #1846
Workspace entries are binding names, and not every valid binding name is a syntactically valid R expression. For example, the current regression tests explicitly cover names such as odd " name.
get(..., envir = .GlobalEnv, inherits = FALSE) makes it explicit that the object shown is exactly the binding represented by the Workspace tree, while title = ... preserves the original object name in the viewer.
So simply changing this back to View(test) would lose those guarantees.
#1837 did not introduce this expression. It restored delivery of the existing session-owned Workspace action to explicitly bound third-party terminals such as vscode-R-console, which is why the expression is now visible there again.
That said, I agree that exposing this relatively verbose implementation detail in the console is not necessarily ideal UX.
We already have a workspace_view sess IPC method, which is currently used when viewing nested Workspace objects. A possible follow-up improvement would be to route root-object View actions through the same IPC path as well. That would keep the exact .GlobalEnv lookup semantics without sending the generated View(get(...)) expression to the terminal at all.
I would therefore treat the current behavior as working as designed rather than a regression, but I think this issue can be useful for discussing whether root Workspace View should also use the existing workspace_view IPC path.
I agree with the history and lookup rationale: #1805 introduced the explicit lookup, and #1837 restored delivery to explicitly bound third-party terminals. Handling arbitrary binding names and preventing fallback outside .GlobalEnv are good reasons to preserve this lookup. Session ownership is a separate guarantee enforced by the execution/request routing.
I favor using workspace_view consistently for root and nested Workspace objects. The method already accepts an empty path and preserves the root binding's name as the viewer title. That would also avoid exposing the generated expression in the console. The original report is a valid UX concern even though the command change was intentional.
There are a few behavior changes to account for in that follow-up:
Viewer overrides: the IPC handler calls utils::View, whereas the terminal expression resolves View through the session's search path. A user- or console-provided View in .GlobalEnv would therefore be bypassed. We should check whether downstream consoles rely on this.
R Interactive presentation: the current root command produces inline rich output for supported objects, whereas workspace_view uses the viewer notification path and opens a viewer panel. I think treating the Workspace button as an inspection action is reasonable, but this is an observable presentation change.
Busy, disconnected, and stale sessions: Interactive submissions queue while R is busy, whereas inspection requests reject. sessionRequest currently catches failures, logs them, and returns undefined, so simply removing the root-command branch could make failed clicks appear silent. The follow-up should show an actionable error and preserve validation of the node's originating session, including after reconnect/restart.
Local validation against the current checkout: the targeted sess list/viewer suite passed all 437 checks. Direct R probes confirmed that root IPC preserves non-syntactic names and titles, rejects lookup outside .GlobalEnv, bypasses a global View override, and emits a viewer notification where the current Interactive command emits inline display output.
Activity
eitsupi commentedon Oct 7, 2026
I also replied in #1836, but to clarify the background in more detail here:
This command form is currently intentional, and was introduced by #1805 rather than #1837.
Before #1805, the Workspace viewer effectively sent:
View(test)#1805 made Workspace actions session-aware and changed root-object viewing to use the exact binding from
.GlobalEnv:There are two reasons for this form:
odd " name.get(..., envir = .GlobalEnv, inherits = FALSE)makes it explicit that the object shown is exactly the binding represented by the Workspace tree, whiletitle = ...preserves the original object name in the viewer.So simply changing this back to
View(test)would lose those guarantees.#1837 did not introduce this expression. It restored delivery of the existing session-owned Workspace action to explicitly bound third-party terminals such as vscode-R-console, which is why the expression is now visible there again.
That said, I agree that exposing this relatively verbose implementation detail in the console is not necessarily ideal UX.
We already have a
workspace_viewsess IPC method, which is currently used when viewing nested Workspace objects. A possible follow-up improvement would be to route root-object View actions through the same IPC path as well. That would keep the exact.GlobalEnvlookup semantics without sending the generatedView(get(...))expression to the terminal at all.I would therefore treat the current behavior as working as designed rather than a regression, but I think this issue can be useful for discussing whether root Workspace View should also use the existing
workspace_viewIPC path.@renkun-ken Any thoughts?
renkun-ken commentedon Oct 7, 2026
I agree with the history and lookup rationale: #1805 introduced the explicit lookup, and #1837 restored delivery to explicitly bound third-party terminals. Handling arbitrary binding names and preventing fallback outside
.GlobalEnvare good reasons to preserve this lookup. Session ownership is a separate guarantee enforced by the execution/request routing.I favor using
workspace_viewconsistently for root and nested Workspace objects. The method already accepts an empty path and preserves the root binding's name as the viewer title. That would also avoid exposing the generated expression in the console. The original report is a valid UX concern even though the command change was intentional.There are a few behavior changes to account for in that follow-up:
utils::View, whereas the terminal expression resolvesViewthrough the session's search path. A user- or console-providedViewin.GlobalEnvwould therefore be bypassed. We should check whether downstream consoles rely on this.workspace_viewuses the viewer notification path and opens a viewer panel. I think treating the Workspace button as an inspection action is reasonable, but this is an observable presentation change.sessionRequestcurrently catches failures, logs them, and returnsundefined, so simply removing the root-command branch could make failed clicks appear silent. The follow-up should show an actionable error and preserve validation of the node's originating session, including after reconnect/restart.Local validation against the current checkout: the targeted sess list/viewer suite passed all 437 checks. Direct R probes confirmed that root IPC preserves non-syntactic names and titles, rejects lookup outside
.GlobalEnv, bypasses a globalViewoverride, and emits a viewer notification where the current Interactive command emits inline display output.