mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Support in fish and zsh
This commit is contained in:
parent
08eecf3a39
commit
449cbc9b7b
|
@ -34,13 +34,7 @@ if [ "$VSCODE_INJECTION" == "1" ]; then
|
|||
fi
|
||||
builtin unset VSCODE_SHELL_LOGIN
|
||||
|
||||
# On macOS the profile calls path_helper which adds a bunch of standard bin directories to
|
||||
# the beginning of the PATH. This causes significant problems for the environment variable
|
||||
# collection API as the custom paths added to the end will now be somewhere in the middle of
|
||||
# the PATH. To combat this, VSCODE_PATH_PREFIX is used to re-apply any prefix after the
|
||||
# profile has run. This will cause duplication in the PATH but should fix the issue.
|
||||
#
|
||||
# See #99878 for more information.
|
||||
# Apply any explicit path prefix (see #99878)
|
||||
if [ -n "$VSCODE_PATH_PREFIX" ]; then
|
||||
export PATH=$VSCODE_PATH_PREFIX$PATH
|
||||
builtin unset VSCODE_PATH_PREFIX
|
||||
|
|
|
@ -7,4 +7,10 @@ if [[ $options[norcs] = off && -o "login" && -f $USER_ZDOTDIR/.zprofile ]]; the
|
|||
ZDOTDIR=$USER_ZDOTDIR
|
||||
. $USER_ZDOTDIR/.zprofile
|
||||
ZDOTDIR=$VSCODE_ZDOTDIR
|
||||
|
||||
# Apply any explicit path prefix (see #99878)
|
||||
if (( ${+VSCODE_PATH_PREFIX} )); then
|
||||
export PATH=$VSCODE_PATH_PREFIX$PATH
|
||||
builtin unset VSCODE_PATH_PREFIX
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -22,6 +22,12 @@ or exit
|
|||
|
||||
set --global VSCODE_SHELL_INTEGRATION 1
|
||||
|
||||
# Apply any explicit path prefix (see #99878)
|
||||
if status --is-login; and set -q VSCODE_PATH_PREFIX
|
||||
fish_add_path -p $VSCODE_PATH_PREFIX
|
||||
set -e VSCODE_PATH_PREFIX
|
||||
end
|
||||
|
||||
# Helper function
|
||||
function __vsc_esc -d "Emit escape sequences for VS Code shell integration"
|
||||
builtin printf "\e]633;%s\a" (string join ";" $argv)
|
||||
|
|
Loading…
Reference in a new issue