You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

"complete:13: command not found: compdef" message when launching Terminal

I am new to using Terminal but I have noticed when I do open it I am always greeted with an error message (see attached). I have no idea how or when exactly it started showing up but I noticed it fairly recently. It also is there on new Terminal tabs and I can get rid of it by using the "clear" command. Is there a way to get rid of the message or is there something I accidentally broke?

MacBook Pro 15″, macOS 12.2

Posted on Mar 7, 2022 9:25 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 7, 2022 10:15 AM

When the shell starts, it reads some initial files with commands.


Currently, the default shell is zsh.

It may read and execute the contents of files such as .zshrc on your home folder.


I don't recommend you messing with these unless you are sure you know what you are doing.

As P. Phillips said, Terminal is unforgiving. By messing up, you can get yourself in a lot of trouble.


At present, all we know is that it tries and fails to execute some command called compdef, in the process of executing something called "complete".


First, make sure you know what shell this is. Type


ps


and tell us what the output is.





4 replies
Question marked as Top-ranking reply

Mar 7, 2022 10:15 AM in response to MrGuinness

When the shell starts, it reads some initial files with commands.


Currently, the default shell is zsh.

It may read and execute the contents of files such as .zshrc on your home folder.


I don't recommend you messing with these unless you are sure you know what you are doing.

As P. Phillips said, Terminal is unforgiving. By messing up, you can get yourself in a lot of trouble.


At present, all we know is that it tries and fails to execute some command called compdef, in the process of executing something called "complete".


First, make sure you know what shell this is. Type


ps


and tell us what the output is.





Mar 7, 2022 10:42 AM in response to MrGuinness

Open Terminal Preferences and make sure there is not a command on the general tab or the shell tab of the default profile.


Now, compdef needs to run as it’s the completion definition file. In other words it’s the source file used to complete the path and commands you try to type.

If you can tell us what you’ve modified recently, or installed, we may be able to figure out where the problem exists

"complete:13: command not found: compdef" message when launching Terminal

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