DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 383 forks source link

After executing: vscode doesn't start in project path. #80

Closed sectasy0 closed 2 years ago

sectasy0 commented 2 years ago

After executing this script, when starting a project in vscode via wsl in the terminal, it opens the path 'mnt/c/Program Files/vscode instead of project root directory. I'm using ubuntu 20.04

CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
sectasy0 commented 2 years ago

Okay, I figure this out. After deleting two env variables set by this script everything works fine.

echo "  setx WSLENV BASH_ENV/u"
echo "  setx BASH_ENV /etc/bash.bashrc"
lucacataldo commented 2 years ago

Deleting these env variables didn't work for me unfortunately, it actually cause bash to not open at all in VSCode

gotope commented 2 years ago

HI, I follow your advice, comment the shell script and it works, thanks.

Okay, I figure this out. After deleting two env variables set by this script everything works fine.

echo "  setx WSLENV BASH_ENV/u"
echo "  setx BASH_ENV /etc/bash.bashrc"

the step is: 1. vi ubuntu-wsl2-systemd-script.sh

  1. comment the two lines

    echo " setx WSLENV BASH_ENV/u"

                 #  echo "  setx BASH_ENV /etc/bash.bashrc"
              3. rerun the script with:  bash ubuntu-wsl2-systemd-script.sh --force
              4. reboot WSL and start code 

Deleting these env variables didn't work for me unfortunately, it actually cause bash to not open at all in VSCode

sectasy0 commented 2 years ago

@lucacataldo

Sorry to be so late, but I didn't think there would be any traffic under this thread. Are you getting the same error as mine, or a different one?