This question came from our site for professional and enthusiast programmers.

1

Note that if you get stuck without a shell, you can use Shell > New Command and enter the name of a different shell, e.g., bash, and Terminal will use that shell instead of whatever the shell is set to (make sure that “Run command inside a shell” is not selected). Then you can use that shell to resolve the problem with the other shell, or change the default shell back with sudo chsh -s /bin/bash (or whatever shell you prefer).
–
Chris PageJun 29 '12 at 13:19

If you get stuck without a valid shell, you can use Shell > New Command and enter the name of a different shell, e.g., bash, and Terminal will use that shell instead of the default (make sure that “Run command inside a shell” is not selected).

Then you can use that shell to resolve the problem with the other shell, or change the default shell back with sudo chsh -s /bin/bash $LOGNAME (or whatever shell you prefer).