mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
use remote cli when in remote terminal (#150372)
This commit is contained in:
parent
986ef1c76d
commit
07655f3a23
|
@ -288,6 +288,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||||
all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
|
all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
|
||||||
} else if (platform === 'darwin') {
|
} else if (platform === 'darwin') {
|
||||||
const shortcut = gulp.src('resources/darwin/bin/code.sh')
|
const shortcut = gulp.src('resources/darwin/bin/code.sh')
|
||||||
|
.pipe(replace('@@APPNAME@@', product.applicationName))
|
||||||
.pipe(rename('bin/code'));
|
.pipe(rename('bin/code'));
|
||||||
|
|
||||||
all = es.merge(all, shortcut);
|
all = es.merge(all, shortcut);
|
||||||
|
@ -333,7 +334,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||||
} else if (platform === 'linux') {
|
} else if (platform === 'linux') {
|
||||||
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
||||||
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@APPNAME@@', product.applicationName))
|
||||||
.pipe(rename('bin/' + product.applicationName)));
|
.pipe(rename('bin/' + product.applicationName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,15 @@
|
||||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
# when run in remote terminal, use the remote cli
|
||||||
|
if [ -n "$VSCODE_IPC_HOOK_CLI" ]; then
|
||||||
|
REMOTE_CLI="$(which -a '@@APPNAME@@' | grep /remote-cli/)"
|
||||||
|
if [ -n "$REMOTE_CLI" ]; then
|
||||||
|
"$REMOTE_CLI" "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
function app_realpath() {
|
function app_realpath() {
|
||||||
SOURCE=$1
|
SOURCE=$1
|
||||||
while [ -h "$SOURCE" ]; do
|
while [ -h "$SOURCE" ]; do
|
||||||
|
|
|
@ -3,9 +3,18 @@
|
||||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
# when run in remote terminal, use the remote cli
|
||||||
|
if [ -n "$VSCODE_IPC_HOOK_CLI" ]; then
|
||||||
|
REMOTE_CLI="$(which -a '@@APPNAME@@' | grep /remote-cli/)"
|
||||||
|
if [ -n "$REMOTE_CLI" ]; then
|
||||||
|
"$REMOTE_CLI" "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# test that VSCode wasn't installed inside WSL
|
# test that VSCode wasn't installed inside WSL
|
||||||
if grep -qi Microsoft /proc/version && [ -z "$DONT_PROMPT_WSL_INSTALL" ]; then
|
if grep -qi Microsoft /proc/version && [ -z "$DONT_PROMPT_WSL_INSTALL" ]; then
|
||||||
echo "To use @@PRODNAME@@ with the Windows Subsystem for Linux, please install @@PRODNAME@@ in Windows and uninstall the Linux version in WSL. You can then use the \`@@NAME@@\` command in a WSL terminal just as you would in a normal command prompt." 1>&2
|
echo "To use @@PRODNAME@@ with the Windows Subsystem for Linux, please install @@PRODNAME@@ in Windows and uninstall the Linux version in WSL. You can then use the \`@@APPNAME@@\` command in a WSL terminal just as you would in a normal command prompt." 1>&2
|
||||||
printf "Do you want to continue anyway? [y/N] " 1>&2
|
printf "Do you want to continue anyway? [y/N] " 1>&2
|
||||||
read -r YN
|
read -r YN
|
||||||
YN=$(printf '%s' "$YN" | tr '[:upper:]' '[:lower:]')
|
YN=$(printf '%s' "$YN" | tr '[:upper:]' '[:lower:]')
|
||||||
|
@ -44,11 +53,11 @@ else
|
||||||
VSCODE_PATH="$(dirname "$(readlink -f "$0")")/.."
|
VSCODE_PATH="$(dirname "$(readlink -f "$0")")/.."
|
||||||
else
|
else
|
||||||
# else use the standard install location
|
# else use the standard install location
|
||||||
VSCODE_PATH="/usr/share/@@NAME@@"
|
VSCODE_PATH="/usr/share/@@APPNAME@@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
ELECTRON="$VSCODE_PATH/@@APPNAME@@"
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in a new issue