Skip to content

Command "code" not found for VScode remote in bottle? Here's a solution

Kudos Beluga edited this page Jan 14, 2021 · 1 revision

If something like zsh: command not found: code or

Command 'code' not found, but can be installed with:

sudo snap install code

comes up when in the systemd bottle, while outside the bottle, the code command opens VScode remote perfectly, then you can append to your .zprofile or .profile this code.

code() {
  /mnt/c/Users/<YOUR USERNAME>/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code "$@"
}

Replace with whatever username you have. The path of where VScode might differ between devices, so do a little investigating yourself? After this there should be no problems with VScode!