Skip to content

Attach active terminal doesn't work with screen on a remote server #1276

Description

@zslastman

Hey guys.
I'm connecting with ssh to a remote server. The extension works perfectly if I 'create R terminal' - I can plots just fine with httpgd, the attached R session updates in the status bar etc.. However I"d like to be able to log back into a pre-existing screen session and attach to one of the R sessions I've left runnning overnight or whatever.

I've followed the instructions in advanced usage, so I am running the init-R script, Sys.getenv('TERM_PROGRAM') gives 'vscode', and I can execute .vsc.attach() in the screen session. However this doesn't update the R session attached to vscode - the status bar doesn't change and I can't receive plots. This is kind of inconsistently the case - usually if I start a fresh screen session and open R there it works - but of course this then kind of defeats the purpose of screen. Clearly there's something not getting updated, but e.g. running .First.sys() again doesn't work. Any ideas?

(oh and thank you for writing an incredibly useful tool!)

My Machine: 12.6 (21G115)
remote machine: Linux comp-01-dd5 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Vscode version: Version: 1.74.0 (Universal)

Activity

  1. d-golzato commented on Jan 3, 2023

    @d-golzato

    Hi zlastman! I've been trying many times to reattach to a remote R session running on a screen.
    After a long session of noobie trial and error, I found that attaching to a screen running the Radian terminal, instead
    of the default one, works. All the environment variables are also automatically loaded.
    Let me know if it works for you!

    As a feature suggestion, I think it would be incredible to be able to attach to a remote R session through ssh
    tunnelling, in a similar way to how you connect to a jupyter server through vscode. In this way you would just need a conda environment with the R kernel, instead of a vscode server with all the extensions installed remotely. Unfortunately I lack the coding skills and knowledge to formulate a solution.

    Thanks for this amazing extension, now I'm almost able to completely replace Rstudio and work remotely without the need to use Rstudio server + Rstudio pro.

  2. github-actions commented on Jan 4, 2024

    @github-actions

    This issue is stale because it has been open for 365 days with no activity.

  3. github-actions commented on Jan 18, 2024

    @github-actions

    This issue was closed because it has been inactive for 14 days since being marked as stale.

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