-
Notifications
You must be signed in to change notification settings - Fork 0
Description
To set the TELEMETRY_DISABLED="true" variable as a global environment variable on your Mac (so it persists across terminal sessions and for all users), you can add it to one of your shell configuration files. Here's how to do it based on your shell (zsh, bash, etc.):
Step 1: Determine Your Shell
Run this command to check your default shell:
echo $SHELL- If it shows
/bin/zsh, you're using Zsh (default on macOS since Catalina). - If it shows
/bin/bash, you're using Bash.
Step 2: Add the Variable to the Shell Configuration File
Depending on your shell, edit the appropriate file:
For Zsh (macOS default)
Open ~/.zshrc (for the current user) or /etc/zshrc (system-wide):
nano ~/.zshrcAdd this line at the end:
export TELEMETRY_DISABLED="true"Save (Ctrl + O), then exit (Ctrl + X).
For Bash
Open ~/.bash_profile (for the current user) or /etc/profile (system-wide):
nano ~/.bash_profileAdd the same line:
export TELEMETRY_DISABLED="true"Save and exit.
Step 3: Apply Changes
Run this to reload the shell configuration:
- For Zsh:
source ~/.zshrc
- For Bash:
source ~/.bash_profile
Step 4: Verify
Check if the variable is set:
echo $TELEMETRY_DISABLEDIt should print true.
Or can use the below command to print all env :
printenv
Alternative (System-Wide for All Users)
If you want this variable to apply to all users, you can add it to /etc/zprofile (Zsh) or /etc/profile (Bash) instead.
Now, the variable will persist across terminal sessions and reboots. 🚀