REditorSupport / REditorSupport/vscode-R

Unable to attach R in active vscode terminal in Posit Workbench

Open
#1,636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
I am trying to use R in VScode and I am getting below error message when I try to attach R in the active vscode terminal.

.vsc.attach()
Error in .vsc.attach() : could not find function ".vsc.attach"

To Reproduce
Steps to reproduce the behavior:

  1. Open VS Code session on Posit Workbench
  2. Install R extension for VSCode
  3. Open Terminal and Select "R Terminal"
  4. In the bottom of the page click "R: (not attached)"
  5. Now you will get the Error message like "Error in .vsc.attach() : could not find function ".vsc.attach""

Can you fix this issue by yourself? (We appreciate the help)
No

(If yes,) can we assist you with anything?

(If applicable) Please attach 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/local/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
"r.sessionWatcher": true,

// 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 keyboard contents by pressing F1 and Developer: toggle screencast mode

Environment (please complete the following information):

  • OS: Linux
  • VSCode Version: [e.g. 1.42.0]
  • R Version: [4.5.0]
  • vscode-R version: [2.8.6]

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the listed Posit Workbench, VS Code, R, and vscode-R setup, following the five reproduction steps. Trace why the active R terminal cannot find .vsc.attach(); done means selecting the R terminal and clicking “R: (not attached)” attaches successfully without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, vscode
Domain
cli, developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.