Activate conda environments prior to creating R kernel sessions
This change:
- Makes the Conda R setting visible, with an experimental tag.
- Decorates discovered Conda R environments with
Conda: env_namein the picker. - Runs
conda activateinside the shell that runs Conda R kernels, using a new kernel supervisor feature. This feature is also intended to support other preflight commands in the future. e.g.module load(https://github.com/posit-dev/positron/issues/8075).
The bulk of this change lives in the kernel supervisor: https://github.com/posit-dev/kallichore/pull/55
Supersedes https://github.com/posit-dev/positron/pull/10471.
Release Notes
- Experimental support for starting Conda R sessions in Positron via
conda activate. Note that not all of Positron's R features have been tested with Conda R. (#4398)
New Features
- N/A
Bug Fixes
- N/A
QA Notes
This change brings in a new supervisor version that has more sophisticated startup handling to support the new features, so it is worth checking that old settings like "Run in Shell" continue to work.
I tried building this branch and testing it out but couldn't get it working, maybe something wrong with my environment (macOS)
@wesm did you run npm install after pulling the branch? (the error looks like a supervisor version mismatch, which would happen if you didn't get the new version of the supervisor along with the rest of the code)
I was able to build it successfully, but when I try to start an existing conda R env that I have, I see this:
R 4.4.2 (Conda: my-fantastic-r-env) failed to start up (exit code 1)
The kernel exited before a connection could be established
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.