Skip to content

Can't recreate R Interactive with session watcher and not always using active terminal #402

@andycraig

Description

@andycraig

Describe the bug

If session watcher is on but R: Always Use Active Terminal is off, closing an R terminal created by vscode-R does not undefine rTerm. This means that future commands that should create a new R terminal instead do nothing.

To Reproduce

  1. Enable setting R: Session Watcher
  2. Disable setting R: Always Use Active Terminal
  3. Create file temp.R with content x <- 1
  4. Command R: Run Selection/Line
  5. Observe R Interactive terminal is created and line is sent to terminal
  6. Close R Interactive by clicking on the terminal trashcan icon. Terminal should now be 1: cmd (if on Windows)
  7. Command R: Run Selection/Line

Expected

Terminal R Interactive is created and line is sent to terminal.

Actual

Nothing happens.

This is probably not a very common combination of settings. I only ran into this while trying to debug something else.

I am putting together a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions