When I type brew, I get the output:
zsh: killed brew
Writing out the whole path still gives the same output, so it doesn't seem like a path problem.
Furthermore, running /bin/bash gives the output:
zsh: killed /bin/bash
I changed the names of .zshrc and .zprofile, yet the problem still persisted.
This also doesn't work on programs like pyenv. I also reinstalled xcode-select, yet the problem still persists. Furthermore, using the bash shell simply gives "process completed" (with deleted .bashrc and .bash_profile files).
I have both iterm2 and terminal, and running "/bin/zsh -x" on my mac terminal outputs stuff about iterm2, so I'm not sure what's happening there.