Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot attach session when workspace is under symbolic link #628

Closed
SiNZeRo opened this issue Apr 21, 2021 · 5 comments · Fixed by #827
Closed

cannot attach session when workspace is under symbolic link #628

SiNZeRo opened this issue Apr 21, 2021 · 5 comments · Fixed by #827
Labels

Comments

@SiNZeRo
Copy link

SiNZeRo commented Apr 21, 2021

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Do you want to fix by self? (We hope your help!)

Yes / No

(If yes,) what kind of help do you want? (e.g. Which file should I fix, Survey (related documents)

(If related)setting.json

// R.exe path for windows
"r.rterm.windows": "",

// R path for Mac OS X
"r.rterm.mac": "/usr/local/bin/R",

// R path for Linux
"r.rterm.linux": "/usr/bin/R",

// R command line options (i.e: --vanilla)
"r.rterm.option": [],

// An optional encoding to pass to R when executing the file, i.e. 'source(FILE, encoding=ENCODING)'
"r.source.encoding": "UTF-8",

// Keeping focus when running
"r.source.focus": "editor",

// Use active terminal for all commands, rather than creating a new R terminal
"r.alwaysUseActiveTerminal": false,

// Use bracketed paste mode
"r.bracketedPaste": false,

// Enable R session watcher (experimental)
"r.sessionWatcher": false,

// Delay in milliseconds before sending each line to rterm (only applies if r.bracketedPaste is false)
"r.rtermSendDelay": 8,

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
You can show the keybord contents by pressing F1 and Developer: toggle screencast mode

Environment (please complete the following information):

  • OS: [e.g. Windows, macOS, Linux]
  • VSCode Version: [e.g. 1.42.0]
  • R Version: [e.g. 3.6.2]
  • vscode-R version: [e.g. 1.2.2]

Additional context
Add any other context about the problem here.

@SiNZeRo SiNZeRo added the bug label Apr 21, 2021
@alyst
Copy link

alyst commented Aug 19, 2021

It looks like I have the same problem. I'm using the latest VSCode (1.59.0) and R extension (2.1.0) on two ArchLinux machines (the VSCode settings are synced).
On my laptop /home/<user> is a physical folder, and attaching works without a problem. On another machine /home is a symlink to /pool/home, and attaching does nothing (I just see .vsc.attach() command in the terminal without any messages).
I then tried to explicitly open the workspace from /pool/home/<user>, and R then attaching has worked.

Related to this problem: would it be possible to add some diagnostic output to .vsc.attach()?

@Chengwei94
Copy link

@alyst I am facing the same problem. Have you managed to find a workaround to this?

@alyst
Copy link

alyst commented Sep 9, 2021

@Chengwei94 Now I don't remember exactly. But I think I was temporary switching to the workspace with the absolute path without the symlinks (/pool/home/<user>/...) in my case. After that it started working (also when I switched back to the path with symlinks).

@renkun-ken
Copy link
Member

renkun-ken commented Oct 20, 2021

I could reproduce this. It is caused by R's getwd() will follow the symlink, which is inconsistent with the workspace folder in vscode. We check whether the R's working directory is consistent with the vscode workspace folder, and it is likely that multiple vscode instances are open with different workspace folders, we need to ensure that only the vscode instance with the correct workspace folder open should attach the session.

Looks like we could always follow the symlink of workspace folders on vscode side and check whether they match the R cwd.

@renkun-ken
Copy link
Member

Please try the build from #827.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants