From d4fba1fa267f526434b720a02b3cb3f627e74f4a Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 11 Apr 2019 09:57:03 +0200 Subject: [PATCH] Warn about installing VS Code in WSL --- resources/linux/bin/code.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/linux/bin/code.sh b/resources/linux/bin/code.sh index 55f50b6f1c1..64109f1fa12 100755 --- a/resources/linux/bin/code.sh +++ b/resources/linux/bin/code.sh @@ -3,6 +3,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. +# test that VSCode wasn't installed inside WSL +if grep -qi Microsoft /proc/version; then + echo "To use VS Code with the Windows Subsystem for Linux, please install VS Code in Windows and uninstall the Linux version in WSL. You can then use the '@@PRODNAME@@' command in a WSL terminal just as you would in a normal command prompt." 1>&2 + read -e -p "Do you want to continue anyways ? [y/N] " YN + + [[ $YN == "n" || $YN == "N" || $YN == "" ]] && exit 1 +fi + + # If root, ensure that --user-data-dir or --file-write is specified if [ "$(id -u)" = "0" ]; then for i in $@ -- GitLab