iterm2 and $SHELL
By loic.nagelei... on September 02, 2013 12:38 (imported from Google Code)
I just used chsh(1) to change my login shell to I just used chsh(1) to change my login shell to /bin/zshI just used chsh(1) to change my login shell to `/bin/zsh.
A new iTerm2 window then dutifully starts zsh, and I just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELLI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL gives /bin/zsh. Yet while a new tab also starts zsh, I just used chsh(1) to change my login shell to
/bin/zsh`.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELLI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL gives I just used chsh(1) to change my login shell to
/bin/zsh`.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bashI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives `/bin/bash.
Inside such a 'broken' shell session:
- running I just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -iI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i or I just used chsh(1) to change my login shell to
/bin/zsh`.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --loginI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login makes the spawned shell set the $SHELL variable by itself \- running I just used chsh(1) to change my login shell to
/bin/zsh`.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -iI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -i or just I just used chsh(1) to change my login shell to
/bin/zsh`.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -i
or just zshI just used chsh(1) to change my login shell to /bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -i
or just `zsh makes the spawned shell inherit the $SHELL variable from its parent shell.
Besides, the first tab (new window) being opened with login(1) and the subsequent tabs being opened without login make it look like the latter are spawned from the first one's session, which is not quite the case. It seems the use of login(1) is conditioned by the Working Directory feature.
Also, it seems iTerm did not pick the shell change and passes a broken $SHELL variable before spawning new tabs.
Quitting and restarting iTerm has no effect.
This:
- is wrong
- creates all sorts of complications (e.g with I just used chsh(1) to change my login shell to
/bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -i
or just zsh
makes the spawned shell inherit the $SHELL variable from its parent shell.
Besides, the first tab (new window) being opened with login(1) and the subsequent tabs being opened without login make it look like the latter are spawned from the first one's session, which is not quite the case. It seems the use of login(1) is conditioned by the Working Directory feature.
Also, it seems iTerm did not pick the shell change and passes a broken $SHELL variable before spawning new tabs.
Quitting and restarting iTerm has no effect.
This:
- is wrong
- creates all sorts of complications (e.g with rbenv init -I just used chsh(1) to change my login shell to
/bin/zsh
.
A new iTerm2 window then dutifully starts zsh, and echo $SHELL
gives /bin/zsh.
Yet while a new tab also starts zsh, echo $SHELL
gives /bin/bash
.
Inside such a 'broken' shell session:
- running zsh --login -i
or zsh --login
makes the spawned shell set the $SHELL variable by itself
- running zsh -i
or just zsh
makes the spawned shell inherit the $SHELL variable from its parent shell.
Besides, the first tab (new window) being opened with login(1) and the subsequent tabs being opened without login make it look like the latter are spawned from the first one's session, which is not quite the case. It seems the use of login(1) is conditioned by the Working Directory feature.
Also, it seems iTerm did not pick the shell change and passes a broken $SHELL variable before spawning new tabs.
Quitting and restarting iTerm has no effect.
This:
- is wrong
- creates all sorts of complications (e.g with `rbenv init - which tries to detect what shell it's running under to enable features like autocompletion)
FWIW, 1.0.0.20130622 and 1.0.0.20130319 are both affected.
Additionally I removed every zsh dotfile, and the problem persists (see attached screenshots).
Also, I can't reproduce the behavior on another Mac (with the same iTerm version and the same dotfiles)
![Screen Shot 2013-09-02 at 14.04.05.png](https://storage.googleapis.com/google-code-attachments/iterm2/issue-2610/comment-0/Screen Shot 2013-09-02 at 14.04.05.png)
![Screen Shot 2013-09-02 at 14.04.10.png](https://storage.googleapis.com/google-code-attachments/iterm2/issue-2610/comment-0/Screen Shot 2013-09-02 at 14.04.10.png)