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

Every time R terminal opens in VS Code , getting below...any idea how to fix? #330

Closed
mwilson19 opened this issue May 20, 2020 · 14 comments · Fixed by #348
Closed

Every time R terminal opens in VS Code , getting below...any idea how to fix? #330

mwilson19 opened this issue May 20, 2020 · 14 comments · Fixed by #348
Labels

Comments

@mwilson19
Copy link

[1] FALSE

C:/Users/.../AppData/Local/Continuum/miniconda3/Scripts/activate
Error: unexpected '/' in "C:/"
conda activate base
Error: unexpected symbol in "conda activate"

@mwilson19 mwilson19 added the bug label May 20, 2020
@andycraig
Copy link
Collaborator

Hi @mwilson19, this is almost certainly because you're using the Python extension as well. When using a Python interpreter in a conda/virtualenv/etc. environment, the Python extension will send lines to any new terminal window to try to activate that environment. In this case, it happens after the R console has already been launched.

It would be nice if the Python extension didn't do this for new terminals created by other extensions, although I'm not sure if VS Code provides a way for extensions to check this. I will have a look at the Python extension's issue tracker to see if this has been raised there.

@andycraig
Copy link
Collaborator

I created an issue at the Python extension's repo: microsoft/vscode-python#11963

@mwilson19
Copy link
Author

Thank you, man i'm novice but still struggling with session watcher, was working fine but now the init.R doesn't seem to be working...so the plots / data frames etc.. are not rendering...code is working fine.

@renkun-ken
Copy link
Member

@mwilson19 Does the session watcher work with Python extensions inactivated? Does your R session start normally with init.R sourced?

@mwilson19
Copy link
Author

Let me try with inactivated. Right now the vscode-R directory is located along with my working files, should it be placed somewhere else and how can i source properly? Thank you!

@mwilson19
Copy link
Author

Yep still not working when python ext deactivated. I bet it's not sourcing the init.R file properly...Thank you.

@renkun-ken
Copy link
Member

Are you creating R terminal via R: Create R terminal command or launch R session in the terminal yourself?

@mwilson19
Copy link
Author

R: create R terminal, i see "R Interactive" as the terminal , then run script to plot.

@renkun-ken
Copy link
Member

Do you see any error on R terminal startup? If not, would you please post the output of ls.str(getOption("vscodeR"))?

@mwilson19
Copy link
Author

ls.str(getOption("vscodeR"))
attach : function ()
capture_str : function (object)
check_null_dev : function ()
dataview : function (x, title)
dataview_data_type : function (x)
dataview_table : function (data)
dir : chr "C:\Users\mwilson\OneDrive\Documents\Programming\R\.vscode\vscode-R"
dir_plot_history : chr "C:\Temp\Rtmpmg5xtt/images"
dir_session : chr "C:\Users\mwilson\OneDrive\Documents\Programming\R\.vscode\vscode-R/6460"
globalenv_file : chr "C:\Users\mwilson\OneDrive\Documents\Programming\R\.vscode\vscode-R/6460/globalenv.json"
new_plot : function ()
null_dev_id : Named int 2
null_dev_size : num [1:2] 10.1 10.1
pid : int 6460
platform : List of 8
$ OS.type : chr "windows"
$ file.sep : chr "/"
$ dynlib.ext: chr ".dll"
$ GUI : chr "vscode"
$ endian : chr "little"
$ pkgType : chr "win.binary"
$ path.sep : chr ";"
$ r_arch : chr "x64"
plot_file : chr "C:\Users\mwilson\OneDrive\Documents\Programming\R\.vscode\vscode-R/6460/plot.png"
plot_history_file : NULL
plot_updated : logi FALSE
rebind : function (sym, value, ns)
respond : function (command, ...)
response_file : chr "C:\Users\mwilson\OneDrive\Documents\Programming\R\.vscode\vscode-R/response.log"
tempdir : chr "C:\Temp\Rtmpmg5xtt"
unbox : function (x)
update : function (...)

@mwilson19
Copy link
Author

Thanks, and also yes, i see a [1] FALSE every time opening R terminal

@mwilson19
Copy link
Author

Just noticing - I am seeing temp folders being created and can view the png plots , but it seems not rendering live in vs code. Also seems I get the .vscode folder with vscode-R in several directories depending on where I started my terminal session. Is there a way I can source from same point everytime ?

@renkun-ken
Copy link
Member

The [1] FALSE is fixed by #303 but not released yet.

Currently, session watcher only works when the R session is started from the same directory you open as the workspace root in VSCode.

And I notice that your workspace folder is in OneDrive which would not work in a software-syncing folder (see #179) due to lack of watch functionality.

Would you like to try open a folder not in OneDrive folder and also as the workspace folder in VSCode and the session watcher should work.

@mwilson19
Copy link
Author

Ok thank you !

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.

3 participants