Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Issues every time I run the terminal

Hello everyone,


I think I messed up with my terminals configuration. Every time I open it I am being welcomed by the following message


HOME=/Users/nulled
LC_CTYPE=UTF-8
LOGNAME=nulled
OLDPWD=/Users/nulled
PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
PWD=/Users/nulled
SHELL=/bin/zsh
SHLVL=1
TERM=xterm-256color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=445
USER=nulled
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0


I have tried to see if there is something wrong with ~/.zshrc but I couldn't identify the issue. Also in the Terminals preferences -> profile settings -> shell, there isn't a startup run command set, so it shouldn't be from this as well. I would really appreciate any help


Kind Regards

MacBook Air 13″, macOS 12.5

Posted on Aug 20, 2022 2:55 AM

Reply
13 replies

Aug 20, 2022 8:53 AM in response to nulledx

Perhaps look for a "cat" or some other command referencing the configuration file in one of the zsh configuration files (there may be several). Could it be like a Message of the Day being displayed which has been pointed to the configuration file? I've never used this command line feature, so I'm not sure how it is configured or set, I just know it exists.


Try creating a new macOS user account. Log out of your current user account and log into the new user account. Do you have the same problem? If so, then it is affecting the default configuration file or templates for the zsh profiles which may be located somewhere in "/etc".

Aug 20, 2022 10:31 AM in response to nulledx

.zshrc isn’t the only script executed at zsh login.


Here are the scripts active at login and logout: .zshenv, .zprofile, .zshrc, .zlogin, .zlogout


Look for an env or export command.


Probably not a cat command with environment variables shown, but weirder scripts have been written.


PS: There are also system-wide zsh scripts stored in /etc with the same names less the leading dot, but those are less often modified. (To test whether those /etc scripts are involved the entirely brute-force way, temporarily create a new login and login and open Terminal.app there.)


Aug 21, 2022 4:53 AM in response to MrHoffman

Thank you both for your input. @MrHoffman, I tried for looking into the login and logout scripts, I believe only two were empty but the .zshrc is the following


export
PATH=/opt/homebrew/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/usr/


I believe the zshrc could be the problem because I had some issues with the golang PATH and I did some changes there but reverted them so that's why I'm confused. Is there a way to completely reset the zsh scripts to default? Quick edit: I created a new user, logged in there and the terminal was working just fine, switched to my main user and the problem still persist.

Aug 23, 2022 12:48 AM in response to vmjn_27

@vmjn_27 In my case the problem was that in the .zshrc file the export command was on two lines instead of one. You can see as well in my previous comments. It should be:


export PATH=.....


Instead of:


export
PATH=......


Given this change, saving the file and restarting the terminal you can observe that it is fixed. But if the problem still persist, probably something else triggers it.


Kind Regards

Issues every time I run the terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.