Skip to content

Commit

Permalink
Fix cli.js always opening from WSL shell
Browse files Browse the repository at this point in the history
Also support relative paths

Fixes #13138
  • Loading branch information
Tyriar committed Jan 14, 2017
1 parent 7eeae68 commit 9c298b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/win32/bin/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
NAME="@@NAME@@"
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
ELECTRON="$VSCODE_PATH/$NAME.exe"
if grep -q Microsoft /proc/version; then
# If running under 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
if [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then
CLI=$(cygpath -m "$VSCODE_PATH/resources/app/out/cli.js")
else
Expand Down

0 comments on commit 9c298b0

Please sign in to comment.