mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
code doesn't open in remote-wsl under WSL2. For microsoft/vscode-remote-release#714
This commit is contained in:
parent
659c8c00c8
commit
3bffb1561c
|
@ -11,8 +11,18 @@ VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
|
|||
ELECTRON="$VSCODE_PATH/$NAME.exe"
|
||||
if grep -qi Microsoft /proc/version; then
|
||||
# in a wsl shell
|
||||
WSL_BUILD=$(uname -r | sed -E 's/^.+-([0-9]+)-[Mm]icrosoft/\1/')
|
||||
if [ $WSL_BUILD -ge 17063 ] 2> /dev/null; then
|
||||
if ! [ -z "$WSL_DISTRO_NAME"]; then
|
||||
# $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2
|
||||
WSL_BUILD=18362
|
||||
else
|
||||
WSL_BUILD=$(uname -r | sed -E 's/^.+-([0-9]+)-Microsoft/\1/')
|
||||
if ! [ -z "$WSL_BUILD" ]; then
|
||||
WSL_BUILD=0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $WSL_BUILD -ge 17063 ]; then
|
||||
# $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2
|
||||
# WSLPATH is available since WSL build 17046
|
||||
# WSLENV is available since WSL build 17063
|
||||
export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
|
||||
|
|
Loading…
Reference in a new issue