status is-login does not work for iTerm2
changing is-login to is-interactive works for both iTerm2 and Terminal.
Background: Installed pyenv using fisher.
fisher pyenv
Using Terminal, running python in a directory with 3.6.1 in .python-version, starts python 3.6.1. However, when I use iTerm2, same steps do not have same results. Typing python opens up the python 2.7.10 which is the default python shipped with Darwin.
Doing which python in both the pseudo terms result in different python executables too. In iTerm2
/usr/bin/python and in Terminal it goes to /Users/tdasgupt/.pyenv/shims/python.
Test:
With the above change, correct version of python is picked up from the .python-version files. env shows PATH contains PATH=/Users/tdasgupt/.pyenv/shims: in both iTerm2 and Terminal. which python goes to /Users/tdasgupt/.pyenv/shims/python for both.
Not tested:
Any scenarios that is dependent on status is-login check in pyenv/conf.d/pyenv.fish. Also any scenario that will double execute this script so as to add the shim path despite it being added. Not sure how to reproduce such a scenario. If such a case exists, probably need to change to check if path has pyenv/shim before adding.
You should configure iTerm2 to use login sessions for your shell. If not, it won't do certain actions that are part of 'login', like setting up your PATH. This is normally the case when you leave the Command option on Login Shell in iTerm2's preferences (General) and properly set the shell for your user by running a chsh -s /path/to/shell. Alternatively, if you want to provide a command instead in iTerm2's settings set the command to /path/to/fish -l instead, to use a login shell.
Crap, didn't meant to hit the Close button just yet, sorry about that.