prevent `.zlogin` and `.zprofile` from running more than once (#238388)

Fix #238296
pull/212294/merge
Megan Rogge 2025-01-21 13:57:07 -06:00 committed by GitHub
parent 5a6c2fa66d
commit 0ac5cce008
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,12 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------------------------------------
# Prevent recursive sourcing
if [[ -n "$VSCODE_LOGIN_INITIALIZED" ]]; then
return
fi
export VSCODE_LOGIN_INITIALIZED=1
ZDOTDIR=$USER_ZDOTDIR
if [[ $options[norcs] = off && -o "login" && -f $ZDOTDIR/.zlogin ]]; then
. $ZDOTDIR/.zlogin

View File

@ -2,6 +2,13 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------------------------------------
# Prevent recursive sourcing
if [[ -n "$VSCODE_PROFILE_INITIALIZED" ]]; then
return
fi
export VSCODE_PROFILE_INITIALIZED=1
if [[ $options[norcs] = off && -o "login" ]]; then
if [[ -f $USER_ZDOTDIR/.zprofile ]]; then
VSCODE_ZDOTDIR=$ZDOTDIR