arkane-systems / genie

A quick way into a systemd "bottle" for WSL
Other
1.85k stars 104 forks source link

Command 'code' not found #218

Open lopugit opened 2 years ago

lopugit commented 2 years ago

Windows version (build number): Find this by running winver

Version 21H1 19043.1348

Linux distribution: i.e. Debian bullseye, Ubuntu focal, etc. If your distro was not installed from the Microsoft Store, please indicate source and method of installation.

Ubuntu Focal

Genie version: The output of genie --version

1.44

Describe the bug A clear and concise description of what the bug is.

When I enter genie shell via genie -s, and try to run the code command, the WSL vscode version, I get the error Command 'code' not found

This is only when inside the genie shell, when I'm outside, code command works fine

Confirm that you are running inside the bottle: The output of genie -b.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

code should be in PATH ?

Screenshots If applicable, add screenshots to help explain your problem.

e7c972b428e2b873aecdfff1db1b5a72

Additional context Add any other context about the problem here.

I confirm that I have read the ENTIRE supplied readme file and checked for relevant information on the repository wiki before raising this issue, and that if the solution to this issue is found in either location, it will be closed without further comment:

letrhee commented 2 years ago

It seems that the PATH environment is not transmitted well.

I wrote the following at the top of the .zshrc:

if [[ -v INSIDE_GENIE ]]; then
   source <(systemctl show-environment | awk '{print "export "$0}')
fi

Of course, note that this method also has a problem of importing unnecessary environment variables.

(See also, https://github.com/arkane-systems/genie/wiki/No-Windows-interop-when-connecting-to-WSL-genie-via-ssh https://github.com/arkane-systems/genie/wiki/Command-%22code%22-not-found-for-VScode-remote-in-bottle%3F-Here%27s-a-solution ).