Likely you edited a file such as .profile or .bash_profile, or you installed an application that did. These are hidden files inside your home directory (not everyone has them) so you will not be able to see them from Finder unless you have turned the visibility of hidden files one. Turning them on can be done with TinkerTool. It could also be done with Terminal, but that's currently decommissioned.
Once you can see the file(s) you can open them in a text editor and fix what you changed, or if there's nothing important in them, just delete the files. Some text editors (like TextWrangler) can open hidden files from their interface so you don't have to worry about messing with the above app.
Try restarting.
Thanks a lot for all the replies, i restarted my computer today and terminal is working again.
beat me to it... you would be shocked at the number of computer problems that can be fixed by reboot.
haha restarting sure didn't help my case... I think I followed a Mac tutorial on how to show disk/read write stuff during that panic when all Imac Mini's M1 was writing to the SSD too much. I followed some tutorial and now it has never worked since then. Trying to open a new shell window and such never worked, although the solution of making a new user and then coping their files seems to make a lot of sense. Might give that a shot
I wanted to login and say THANK YOU! I upgraded my M1 mac to Monterey and still had the same issue, this fixed it immediately! I missed my terminal so much ahahah thank you with the bottom of my heart!Looks like you put something into the .zprofile file (it runs automatically when a new Terminal window is opened) that makes the shell exit immediately.
Open your home directory (the directory with the same name as your username) in Finder, press Cmd+Shift+. (period) to show hidden files, delete .zprofile, press the shortcut again to hide hidden files. That should fix it.