Open scotty-c opened 4 years ago
For me the VSCode terminal opens in the correct folder, but when directly executing a command, such as "wsl ls" it always executes in the root folder after installing this script.
My terminal fails to launch completely in the VSCode. It prints out this message and exits:
https://github.com/microsoft/vscode/issues/102090
This might be causing the problem 🤷 https://github.com/DamionGans/ubuntu-wsl2-systemd-script/blob/ca7b15b082d1bf23f43123a019e61ad0926fabbd/enter-systemd-namespace#L45-L47
I'm getting the same error as @enzy, and also an error from xargs:
@diddledan Any ideas on this one, I am free to help out with a PR
Getting the same problem, all my terminals in vscode always open in:
/mnt/c/Users/wilda/AppData/Local/Programs/Microsoft VS Code
Anyone found any solutions to this? I'm stumped. I tried comparing the output of code . --verbose
in my distro that is starting in the wrong directory (first block) with one that is working properly (second). They seem to be the same
Invoking: cd "/mnt/c/Users/kvnlo/AppData/Local/Programs/Microsoft VS Code" && ELECTRON_RUN_AS_NODE=1
"/mnt/c/Users/kvnlo/AppData/Local/Programs/Microsoft VS Code/Code.exe" "resources/app/out/cli.js"
"--ms-enable-electron-run-as-node" "--verbose"
"--folder-uri=vscode-remote://wsl+Ubuntu-20.04/home/kevin/dev/blog" "--remote=wsl+Ubuntu-20.04"
Invoking: cd "/mnt/c/Users/kvnlo/AppData/Local/Programs/Microsoft VS Code" && ELECTRON_RUN_AS_NODE=1
"/mnt/c/Users/kvnlo/AppData/Local/Programs/Microsoft VS Code/Code.exe" "resources/app/out/cli.js"
"--ms-enable-electron-run-as-node" "--verbose"
"--folder-uri=vscode-remote://wsl+Ubuntu-20.04/home/kevin/dev/blog" "--remote=wsl+Ubuntu-20.04"
I know for many of you systemd is required. For me the solution was to uninstall: https://github.com/FiestaLake/ubuntu-wsl2-systemd-script/blob/master/uninstall.sh Now the folder in terminal is good again
Sadly I had to do this as well
When you open a terminal inside vscode within WSL2 it is defaulting to
/mnt/c/Users/username/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.3
not the folder you open it in. I understand that its getting it from the~/.system-env
file and we are setting the env with this commandcmd.exe /C setx WSLENV BASH_ENV/u
More than happy to work on a PR to help fix the issue. I am not 100% sure what this command
cmd.exe /C setx WSLENV BASH_ENV/u
is setting