Closed Samyak2 closed 3 months ago
Hmm. I can reproduce this. I think what's going on is it does actually launch you into zsh
(echo "$0"
shows zsh
on my machine), but it doesn't update the $SHELL
variable:
> echo $SHELL
/opt/homebrew/bin/fish
> bash
$ echo $SHELL
/opt/homebrew/bin/fish
$ exec zsh
% echo $SHELL
/opt/homebrew/bin/fish
I'm not sure how to fix this!
Apparently this is expected behavior:
SHELL
always (well, if not set manually) expands to the login shell (defined in/etc/passwd
) of the user, not necessarily the shell [the] user [is] currently using. — https://askubuntu.com/a/748523
I'm going to close this issue. Is this behavior causing you any issues? Is your zsh
config available as expected in nix-shell
? If you're having trouble, feel free to re-open this.
You're right! It is zsh. I had given up after checking $SHELL
and did not try to use the shell to verify that it is indeed zsh. I had starship enabled on both bash and zsh, so both the prompts looked the same either way.
TIL. Thank you!
Firstly, thank you for this tool.
I have set up
nix-your-shell
for zsh in my home-manager. zsh is my default login shell too. I used the following configuration (paraphrased, not an exact snippet from my config):Now when I use
nix shell
, it works correctly and I'm dropped into zsh:But with
nix-shell
, I'm dropped into bash:I don't have any other alias set up for
nix-shell
. Not sure where to start looking for the problem. I'm somewhat new to nix, so let me know if I got something wrong here.