Home > other >  Everytime I open a terminal window it prints the 'env' variable automatically
Everytime I open a terminal window it prints the 'env' variable automatically

Time:06-03

For some reason everytime I open a terminal it prints the printenv variable automatically. This didn't happen until recently. How do I turn this off?

I use zsh.

This is what my .zprofile file looks like:

eval "$(/opt/homebrew/bin/brew shellenv)"

I created a .zshrc file myself, because I didn't have one. This is what I put in there:

export 
PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/merdin/Documents/Code/school/narrowcasting:/Users/merdin/.composer/vendor/bin

CodePudding user response:

From your problem statement it's not clear what is actually happening but I'll assume you mean that either the output of the env command is being displayed or the value of one or more environment variables is being displayed. For the former simply look for a env or printenv command in your ~/.zshrc, ~/.zenv, ~/.zprofile, and ~/.zlogin files (you probably have only ~/.zshrc but zsh reads all of them depending on how it is started). For the latter look for echo or print commands that shouldn't be there.

Note that zsh doesn't do any of the things I just described automatically. If the behavior started recently then presumably you did some customization of your shell configuration. Possibly you installed something like Oh-My-Zsh or a plugin it manages without understanding the consequences.

CodePudding user response:

I found the issue. There was a \n after my export in the .zshrc file. So I removed that and apparently that caused this issue.

  • Related