Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

status is-login does not work for iTerm2 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tathagata
Copy link

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.

changing is-login to is-interactive works for both iTerm2 and Terminal.
@tathagata tathagata changed the title is-login for iTerm2 does not work status is-login for iTerm2 does not work Mar 19, 2018
@tathagata tathagata changed the title status is-login for iTerm2 does not work status is-login does not work for iTerm2 Mar 19, 2018
@daenney
Copy link
Collaborator

daenney commented Mar 24, 2018

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.

@daenney daenney closed this Mar 24, 2018
@daenney
Copy link
Collaborator

daenney commented Mar 24, 2018

Crap, didn't meant to hit the Close button just yet, sorry about that.

@daenney daenney reopened this Mar 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants