Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using zsh as your default shell makes nix-shell have a strange prompt #4178

Closed
thespacepanda opened this issue Sep 20, 2014 · 9 comments
Closed

Comments

@thespacepanda
Copy link

This only came up after making zsh my default shell. when I run nix-shell, I get a prompt that looks like this: []$NORMALPROMPT[]. This is quite cumbersome as the up arrow and tab functionality is also missing. However, the problem can be worked around by running nix-shell --command zsh, which doesn't work with --pure, and doesn't seem to pull in the correct path.

@thespacepanda
Copy link
Author

I have isolated and solved the issue. It seems I had pkgs.bash installed instead of pkgs.bashInteractive. Installing bashInteractive fixed the readline problem as well as the strange prompt. Maybe bashInteractive should be installed by default (it may be and I just removed it by switching to zsh and explicitly listing pkgs.bash in system wide packages, followed by a garbage collect).

@Fuuzetsu
Copy link
Member

It is not necessary to specify bash in systemPackages at all, it comes with stdenv.

@thespacepanda
Copy link
Author

But is it necessary to specify bashInteractive? I know installing that is what fixed my issue

@Fuuzetsu
Copy link
Member

It should not be, there is no mention of bash (or zsh) anywhere in my configs.

@thespacepanda
Copy link
Author

Yes, but are you running zsh as your default shell? This problem only started when I switched to zsh.

@Fuuzetsu
Copy link
Member

No, I am not. Seems like something that should have been mentioned in the OP.

@thespacepanda
Copy link
Author

I have updated it, but I figured that being in the title would have been enough. Since this is an issue, but I have found the fix (making sure bashInteractive is installed on your system) should this be reopened and moved somewhere appropriate? I think that with bash as your default shell, nixos makes sure you have bashInteractive installed (since you will definitely be using it interactively), but with zsh as your default shell, it only thinks it needs bash. So maybe it is a dependency issue for nix-shell? Or something about the way nixos handles default shells?

@Fuuzetsu
Copy link
Member

I think the best way would be to open on the nix repo complaining that it requires the user to manually specify a runtime dependency.

@thespacepanda
Copy link
Author

I have done so (NixOS/nix#355). Thank you for your help and guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants