Support in fish and zsh

This commit is contained in:
Daniel Imms 2023-01-11 05:50:35 -08:00
parent 08eecf3a39
commit 449cbc9b7b
No known key found for this signature in database
GPG key ID: 7116259D505CA628
3 changed files with 13 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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)