sarugaku / shellingham

Tool to Detect Surrounding Shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Always detects fish

hynek opened this issue · comments

This started happening as of 1.5.3, while it works in 1.5.0post1.

My default shell is Fish, but occasionally I run things under bash – notably PDM activation scripts under Direnv.

With 1.5.3, on both bash and zsh import shellingham; shellingham.detect_shell(), it always returns fish:

python -m venv venvvenv/bin/python -m pip install shellingham
Looking in indexes: https://pypi.vm.ag/root/vrmd/+simple/
Collecting shellingham
  Using cached https://pypi.vm.ag/root/pypi/%2Bf/419/c6a164770c9c7/shellingham-1.5.3-py2.py3-none-any.whl (9.7 kB)
Installing collected packages: shellingham
Successfully installed shellingham-1.5.3venv/bin/python -c 'import shellingham; print(shellingham.detect_shell())'
('fish', '/opt/homebrew/bin/fish')zsh
hynek@nazare tmp % venv/bin/python -c 'import shellingham; print(shellingham.detect_shell())'
('fish', '/opt/homebrew/bin/fish')
hynek@nazare tmp %

❯ bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
$ venv/bin/python -c 'import shellingham; print(shellingham.detect_shell())'
('fish', '/opt/homebrew/bin/fish')
$ exitvenv/bin/pip install shellingham==1.5.0.post1
Looking in indexes: https://pypi.vm.ag/root/vrmd/+simple/
Collecting shellingham==1.5.0.post1
  Using cached https://pypi.vm.ag/root/pypi/%2Bf/368/bf8c00754fd4f/shellingham-1.5.0.post1-py2.py3-none-any.whl (9.4 kB)
Installing collected packages: shellingham
  Attempting uninstall: shellingham
    Found existing installation: shellingham 1.5.3
    Uninstalling shellingham-1.5.3:
      Successfully uninstalled shellingham-1.5.3
Successfully installed shellingham-1.5.0.post1zsh
hynek@nazare tmp % venv/bin/python -c 'import shellingham; print(shellingham.detect_shell())'
('zsh', 'zsh')
hynek@nazare tmp %

❯ bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
$ venv/bin/python -c 'import shellingham; print(shellingham.detect_shell())'
('bash', 'bash')

macOS 13.5.1 (22G90) on an ARM Mac; lmk if I can provide you with more information.