-
Notifications
You must be signed in to change notification settings - Fork 21
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
Using an ir kernel as R_app #249
Comments
Please, run these commands in an R session started by Sys.getenv("R_DEFAULT_PACKAGES")
Sys.getenv()[grep("^RNVIM_", names(Sys.getenv()))] The The first lines of if (Sys.getenv("RNVIM_TMPDIR") == "")
return(invisible(NULL)) That is, the TCP client is started only if the environment variable That said, I have zero experience with Jupyter and it seems you that already knew everything I explained. But I hope that the explanation might be useful to someone wanting to help you. |
Thanks for the swift response!
There are nine of them? This could be an issue. R.nvim/lua/r/external_term.lua Line 141 in 4cf60ea
grepping around I see a few other environment variable names that fit. Which do you expect to see? When I run without the custom script, I see an additional |
Ah, when running with a normal R console. I also notice that the compldir and tmpdir don't have |
I'm facepalming massively right now. The env vars I see have been persisting in the kernel this whole time, I think I remember manually setting them as the first thing I tried. Even when you restart an R kernel, the env vars persist (something I just learned). So the secret and ID will have been wrong this whole time. Starting the kernel with |
The nine variables:
|
This |
Note that vim.env.RNVIM_ID = vim.fn.rand(vim.fn.srand())
vim.env.RNVIM_SECRET = vim.fn.rand() |
Thank you. Unfortunately, even with a script to set all of the environment variables correctly before calling I'm out of ideas for now |
You should not set any variable. They must all be set by #/bin/sh
env > /tmp/Rnvim_env and put in my R_app = '~/bin/fake_R', Then, after Perhaps, Jupyter restricts what variables are read from the calling environment. |
Yeah it certainly seems to be the case. I attempted to work around it by setting each variable by sending the corresponding In theory this should have the same result (ie. all of the environment variables are set to the same values they'd otherwise have), and I was able to see them all set when I ran the grep command, but unfortunately this doesn't seem to have been enough |
Does this sound possible? I've fiddled around a little with it, and run into issues, but I don't really understand the internals of this plugin too well, so I figured I'd ask.
The motivation is to get R.nvim features to work with an existing jupyter kernel (the kernel is running on the same machine as nvim btw).
I'm setting
R_app = "/path/to/bash_script.sh"
where the tmp file is created by something else.
When I do this, I can start the plugin/create a tmux split with
\rf
and the split opens, the jupyter console starts and works as expected (ie. it has access to variables I've evaluated in the jupyter kernel). But R.nvim gets stuck atvim.g.R_Nvim_status = 6
so whenever I attempt to send code to the terminal I getR is not ready yet.
I've tried to run
require("nvimcom")
manually in the jupyter console b/c I suspect autoload would not work since the process is already running, but this doesn't change anything. The require succeeds, however, so it's able to find the package.When I run
Sys.getenv(RNVIM_ID)
in the console I see a value, same for all the other environment variables.Any suggestions would be appreciated!
The text was updated successfully, but these errors were encountered: