Skip to content

Canonical data viewer and plot integration still open in external R windows with vscode-R 3.0.0 #1794

Description

@leanhdung1994

Environment

  • OS: Windows 11
  • VS Code: latest version
  • vscode-R: 3.0.0
  • R: 4.6.1
  • R console: arf 0.5.3

Problem

The VS Code-R session integration does not seem to be working correctly. In particular:

  1. View(df) opens the native R data viewer in a separate Windows window instead of opening the data frame in the VS Code data viewer.
  2. plot(...) opens a separate native R Graphics device window instead of displaying the plot inside VS Code.

This seems to indicate that the R session watcher/session integration is still not attaching correctly.

Steps to reproduce

For example, run:

x <- 1:10
y <- x^2

df <- data.frame(x, y)

View(df)

plot(x, y, type = "b", main = "Test Plot")
Image

Activity

  1. grcatlin commented on Sep 28, 2026

    @grcatlin
    Contributor

    I can reproduce on macOS with a few specific steps.

    1. Open a directory in VS Code - be sure there are no active terminals.
    2. Create an R terminal r.createRTerm. [sess] Connected to VS Code should be printed. View() and plot() should work as expected.
    Image
    1. Quit VS Code without closing the active R terminal. Or swap to a different directory workbench.action.openRecent (ctrl + r) without closing the active R terminal.
    2. Open VS Code again or ctrl + r back to the original directory, sess shows an IPC error.
    Image
    1. Run the same commands as earlier. Now, XQuartz pops up instead.
    Image

    For me, I can fix by killing that old terminal and then making a new R terminal. Running the same commands shows the intended Viewer.

    @leanhdung1994 interestingly I cannot reproduce this on Windows. Do you have sess installed?

  2. leanhdung1994 commented on Sep 28, 2026

    @leanhdung1994
    Author

    @grcatlin I followed your first two steps and encountered an error

    Image

    Yes, sess is already installed in my laptop

  3. leanhdung1994 commented on Sep 28, 2026

    @leanhdung1994
    Author

    I have run some commands for diagnostics

    +  # Environment variables the extension set
    +  # Environment variables the extension set
    +  Sys.getenv()[grep("^SESS_|^JGD_", names(Sys.getenv()))]
    +  
    +  # Discovery file: exists? contents?
    +  f <- Sys.getenv("SESS_DISCOVERY_FILE")
    +  file.exists(f)
    +  cat(readLines(f, warn = FALSE), sep = "\n")
    +  
    +  # Does the pipe from the discovery file exist? (copy the pipe name from its "endpoint")
    +  "vscode-r-7405fda80815652a" %in% list.files("//./pipe/")
    +  
    +  # The failing call, with a full traceback
    +  sess::connect()
    +  warnings()
    [1] "R version 4.6.1 (2026-06-24 ucrt)"
    R version 4.6.1 (2026-06-24 ucrt)
    Platform: x86_64-w64-mingw32/x64
    Running under: Windows 11 x64 (build 26200)
    
    Matrix products: default
      LAPACK version 3.12.1
    
    locale:
    [1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
    [5] LC_TIME=English_United States.utf8    
    
    time zone: Europe/Paris
    tzcode source: internal
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    loaded via a namespace (and not attached):
    [1] compiler_4.6.1 sess_3.0.0    
    [1] ‘3.0.0’
    [1] "C:/Users/Akira/AppData/Local/R/win-library/4.6/sess"
    [1] "C:/Users/Akira/AppData/Local/R/win-library/4.6" "C:/Program Files/R/R-4.6.1/library"            
    JGD_SOCKET                                        npipe:////./pipe/jgd-04d758d0918964ab
    SESS_DISCOVERY_FILE                               c:\Users\Akira\AppData\Roaming\Code\User\globalStorage\reditorsupport.r\sessions\fd1f53a255694fe950e22098cf1fc185.json
    SESS_PLOT_BACKEND                                 auto
    SESS_RSTUDIOAPI                                   TRUE
    [1] TRUE
    {"version":1,"endpoint":"\\\\.\\pipe\\vscode-r-7405fda80815652a","jgdSocket":"npipe:////./pipe/jgd-04d758d0918964ab","terminalPid":24284}
    [1] TRUE
    Warning message:
    In sess::connect() :
      [sess] Connection info not available. Cannot connect to VS Code.
    Warning message:
    In sess::connect() :
      [sess] Connection info not available. Cannot connect to VS Code.
  4. grantmcdermott commented on Sep 28, 2026

    @grantmcdermott
    Contributor

    Two qq:

    1. Did you test against the RC (dev) version of the extension previously? There's a potential sess version mismatch that might be triggering this issue. Regardless, can you try installing sess from R-universe to see if that fixes the issue? See https://github.com/REditorSupport/vscode-R/tree/main/sess#installation
    2. Can you share your R-specific VS Code user settings?
  5. leanhdung1994 commented on Sep 28, 2026

    @leanhdung1994
    Author

    Two qq:

    1. Did you test against the RC (dev) version of the extension previously? There's a potential sess version mismatch that might be triggering this issue. Regardless, can you try installing sess from R-universe to see if that fixes the issue? See https://github.com/REditorSupport/vscode-R/tree/main/sess#installation
    2. Can you share your R-specific VS Code user settings?

    Thank you very much for your help. Installing sess from R-universe solves the problem for me

    Image
  6. grantmcdermott commented on Sep 28, 2026

    @grantmcdermott
    Contributor

    Excellent, thanks for confirming!

    @randy3k maybe we should release a fake v3.0.1 patch version for both vscode-R and sess to head this off?

  7. grcatlin commented on Sep 28, 2026

    @grcatlin
    Contributor

    @grantmcdermott should I open a separate issue or discussion on my earlier comment regarding how I was able to break sess on MacOS? #1794 (comment)

  8. grantmcdermott commented on Sep 28, 2026

    @grantmcdermott
    Contributor

    @grcatlin If the r-universe install didn't fix it, then yes please open it as a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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