MacOS – Terminal stuck at error won’t accept any commands.

command lineerroritermmacosterminal

I was trying to install CLI package from github but I messed up during the process and ended up getting this error. It is persistent and won't go away. Terminal wont accept any commands like mkdir, ls, clear screen. To fix this error I ended up deleting the info.plist file for the terminal ( I am not a very smart person) which somehow bricked terminal and it won't start anymore. I decided to download iTerm, and it still launches with the same old error. What am I supposed to do. Please help me .

enter image description here

Best Answer

Well the error you're getting sounds like you've tried changing the $PATH variable somewhere. Possible candidates (not all of them need to exist) are

  • /etc/profile
  • /etc/bashrc
  • ~/.bash_profile
  • ~/.bash_login
  • ~/.bashrc
  • ~/.profile

Find all lines starting with export that contain the path you've posted above in those files and prefix them with a # to disable them. Restart iTerm and the error should be gone.

Regarding the deleted .plist, do you happen to have a TimeMachine (or other) backup that you might recover it from? Before re-installing everything you could also test creating a new user and copying the file from this account to yours.