Skip to content

executeCode() API should store pending code, run code, and then put pending code back #6680

Closed
@gadenbuie

Description

@gadenbuie

System details:

Positron and OS details:

Positron Version: 2025.02.0 (Universal) build 171
Code - OSS Version: 1.96.0
Commit: 55f7331
Date: 2025-02-10T16:03:19.797Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.3.0

Interpreter details:

R 4.4.2

Describe the issue:

Running the R: Load R package command places devtools::load_all() into the console, appending it next to whatever code is currently in the console.

Steps to reproduce the issue:

  1. Open a project containing an R package
  2. Write, but do not submit, the following code in the Console stop("bad robot")
  3. Run the "R: Load R Package" command
  4. Both the stop() call and devtools::load_all() call will be evaluated. The package will not load because of the error from the stop() call.

A similar problem occurs if you have invalid R code in the Console.

Expected or desired behavior:

The stop("bad robot") code should remain in the console, un-submitted, but the devtools::load_all() is evaluated in the console.

(FWIW, this is the behavior in RStudio.)

Were there any error messages in the UI, Output panel, or Developer Tools console?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiIssues related to API category.area: consoleIssues related to Console category.area: coreIssues related to Core category.bugSomething isn't workingregression

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions