microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.66k stars 28.68k forks source link

code . command not working in wsl environment #228882

Open Mohtelsayed opened 3 days ago

Mohtelsayed commented 3 days ago

Type: Bug

Here is the output after running the command "VSCODE_WSL_DEBUG_INFO=true code .":

VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.22631 Modes: Connection to 'WSL: Ubuntu' could not be established VS Code Server for WSL closed unexpectedly.

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 x 1498)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.77GB (5.85GB free)| |Process Argv|--crash-reporter-id c5f9e7d8-be74-4a0d-86a0-d23c7ec8483a| |Screen Reader|no| |VM|0%| Connection to 'WSL: Ubuntu' could not be established VS Code Server for WSL closed unexpectedly.
Extensions: none
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 f3je6385:31013174 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl2:31139839 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 wkspc-ranged-t:31125599 fje88620:31121564 ```
devmuppet commented 1 day ago

getting the same issue since the latest update....

devmuppet commented 1 day ago

seems to be a bug with the commit version of the server package? Or bad download?

I tried re-installing the wsl plugin and also tried installing an older version but neither worked. Noticed that both ms-vscode-remote.remote-wsl-0.88.3 and ms-vscode-remote.remote-wsl-0.88.2 were in the extension list.

✘-INT mypc:~/jenkins-casc [backups|✚ 1]> VSCODE_WSL_DEBUG_INFO=true code .
+ COMMIT=38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ SERVERDATAFOLDER=.vscode-server
+ realpath /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/bin
+ VSCODE_PATH=/mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code
+ ELECTRON=/mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe
+ IN_WSL=false
+ [ -n Ubuntu5 ]
+ IN_WSL=true
+ [ true = true ]
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION:WT_PROFILE_ID:
+ wslpath -m /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ CLI=C:/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1 /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe C:/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js --locate-extension ms-vscode-remote.remote-wsl
+ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC=c:\Users\joeyjoejoejabbadoo\.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.3
+ [ -n c:\Users\joeyjoejoejabbadoo\.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.3 ]
+ wslpath -u c:\Users\joeyjoejoejabbadoo\.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.3
+ WSL_CODE=/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslCode.sh
+ /mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslCode.sh 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 stable /mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe code .vscode-server .
+ [ -z .vscode-server ]
+ [ .vscode-server = .vscode-insiders ]
+ [ ! -t 0 ]
+ VSCODE_REMOTE_BIN=/home/joeyjoejoejabbadoo/.vscode-server/bin
+ AUTHORITY=wsl+default
+ [ Ubuntu5 ]
+ AUTHORITY=wsl+Ubuntu5
+ dirname /mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslCode.sh
+ /mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslDownload.sh 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 stable /home/joeyjoejoejabbadoo/.vscode-server/bin
+ [ ! -d /home/joeyjoejoejabbadoo/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 ]
+ RC=0
+ [ 0 -eq 100 ]
+ [ 0 -ne 0 ]
+ mktemp /tmp/vscode-distro-env.XXXXXX
+ STORED_ENV=/tmp/vscode-distro-env.kVPrJx
+ env
+ dirname /mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslCode.sh
+ VSCODE_CLIENT_COMMAND=/mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe VSCODE_CLIENT_COMMAND_CWD=/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts VSCODE_CLI_AUTHORITY=wsl+Ubuntu5 VSCODE_CLI_REMOTE_ENV=/tmp/vscode-distro-env.kVPrJx VSCODE_STDIN_FILE_PATH= WSLENV=VSCODE_CLI_REMOTE_ENV/w:ELECTRON_RUN_AS_NODE/w:WT_SESSION:WT_PROFILE_ID: /home/joeyjoejoejabbadoo/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/bin/remote-cli/code .
/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts/wslCode.sh: 68: /home/joeyjoejoejabbadoo/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/bin/remote-cli/code: not found
+ exit 127

i extracted the following script args from the above output:

COMMIT=38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
QUALITY=stable
WIN_CODE_CMD=/mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe
APP_NAME=code
SERVERDATAFOLDER=.vscode-server

and tried to see if i could run the scripts to see what was going on:

joeyjoejoejabbadoo@mypc:/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts$ ./wslCode.sh 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 stable "/mnt/c/Users/joeyjoejoejabbadoo/AppData/Local/Programs/Microsoft VS Code/Code.exe" code .vscode-server
Updating VS Code Server to version 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Removing previous installation...
Installing VS Code Server for Linux x64 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40)
Downloading: 100%
Unpacking: 100%
Unpacked 1765 files and folders to /home/joeyjoejoejabbadoo/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40.

joeyjoejoejabbadoo@mypc:/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts$ code .
joeyjoejoejabbadoo@mypc:/mnt/c/Users/joeyjoejoejabbadoo/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.3/scripts$

Et voilà

@Mohtelsayed - this fixed code . in wsl for me.

@roblourens - not sure where in the scripts thats happening but its a little workaround for now.