iTerm2 terminals close immediately with "argpath=login error=No such file or directory"

Solution 1:

Not sure why it didn't work with Login shell selected, but I changed it to ⌘ command and invoked bash -l or /bin/bash -l to make it work the same way. Hope this helps anyone else who has the same problem!

enter image description here

Solution 2:

I had the same error, and the cause was that my PATH variable wasn't set correctly (I had meddled with it). Restoring a proper value using setenv fixed the issue. If you have meddled with your launchd path, you must edit it with launchctl.

In a terminal:

launchctl
setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

You may have to add the path to your /etc/launchd.conf file, and restart your computer as well. See https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x for more information.