Skip to content

Using an ir kernel as R_app #249

@benlubas

Description

@benlubas

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"

#!/usr/bin/env bash

jupyter console --existing $(cat /tmp/kernel-id)

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 at vim.g.R_Nvim_status = 6 so whenever I attempt to send code to the terminal I get R 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions