Shell WSL2 VSCODE:代码。在Ubuntu中打开VSCode的命令不再工作

Shell WSL2 VSCODE:代码。在Ubuntu中打开VSCode的命令不再工作,shell,visual-studio-code,electron,windows-subsystem-for-linux,Shell,Visual Studio Code,Electron,Windows Subsystem For Linux,当尝试使用code打开WSL2中的任何目录时。会抛出以下错误: paulseph@LP TestBoard [05:45:17] ~$ code . /mnt/c/Users/plk/AppData/Local/Programs/Microsoft VS Code/bin/code: 40: export: World":WT_PROFILE_ID: bad variable name 到目前为止,我已经重新安装了远程WSL插件VSCode,重置了Ubuntu,并将我的.bashrc

当尝试使用
code打开WSL2中的任何目录时。
会抛出以下错误:

paulseph@LP TestBoard [05:45:17] ~$ code .
/mnt/c/Users/plk/AppData/Local/Programs/Microsoft VS Code/bin/code: 40: export: World":WT_PROFILE_ID: bad variable name
到目前为止,我已经重新安装了远程WSL插件VSCode,重置了Ubuntu,并将我的.bashrc文件设置为默认值,但错误依然存在。它似乎引用了名为code的文件中的一个问题,这是第40行:错误导致:

export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")
完整的代码文件如下:

if [ "$VSCODE_WSL_DEBUG_INFO" = true ]; then
    set -x
fi

COMMIT="17299e413d5590b14ab0340ea477cdd86ff13daf"
APP_NAME="code"
QUALITY="stable"
NAME="Code"
DATAFOLDER=".vscode"
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
ELECTRON="$VSCODE_PATH/$NAME.exe"

IN_WSL=false
if [ -n "$WSL_DISTRO_NAME" ]; then
    # $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2
    IN_WSL=true
else
    WSL_BUILD=$(uname -r | sed -E 's/^[0-9.]+-([0-9]+)-Microsoft.*|.*/\1/')
    if [ -n "$WSL_BUILD" ]; then
        if [ "$WSL_BUILD" -ge 17063 ]; then
            # WSLPATH is available since WSL build 17046
            # WSLENV is available since WSL build 17063
            IN_WSL=true
        else
            # If running under older WSL, don't pass cli.js to Electron as
            # environment vars cannot be transferred from WSL to Windows
            # See: https://github.com/Microsoft/BashOnWindows/issues/1363
            #      https://github.com/Microsoft/BashOnWindows/issues/1494
            "$ELECTRON" "$@"
            exit $?
        fi
    fi
fi
if [ $IN_WSL = true ]; then

    export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
    CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")

    # use the Remote WSL extension if installed
    WSL_EXT_ID="ms-vscode-remote.remote-wsl"

    ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID >/tmp/remote-wsl-loc.txt 2>/dev/null
    WSL_EXT_WLOC=$(cat /tmp/remote-wsl-loc.txt)

    if [ -n "$WSL_EXT_WLOC" ]; then
        # replace \r\n with \n in WSL_EXT_WLOC
        WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh
        "$WSL_CODE" "$COMMIT" "$QUALITY" "$ELECTRON" "$APP_NAME" "$DATAFOLDER" "$@"
        exit $?
    fi

elif [ -x "$(command -v cygpath)" ]; then
    CLI=$(cygpath -m "$VSCODE_PATH/resources/app/out/cli.js")
else
    CLI="$VSCODE_PATH/resources/app/out/cli.js"
fi
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
我的VS代码版本是:

Version: 1.47.2 (user setup)
Commit: 17299e413d5590b14ab0340ea477cdd86ff13daf
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
该命令在cmd和powershell中按预期工作。无论如何要让它再次运行