-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Nixos does not ensure bashInteractive is installed when the default shell isn't bash #4260
Comments
Another option is wrap nix-shell with bashInteractive. |
Hmm, yes, I don't see why |
I use zsh and I get this (= garbled prompt and no readline) when running nix-shell too. I have not been able to fix it by installing bashInteractive. It is quite annoying. |
I haven't look into the detail, but |
@iyzsong Yes, thanks, this is what I use now. When I tried it the first time, I used --pure which worked poorly. |
I have an even worse experience with all this. The docs suggest that I can make zsh my default user shell by using the path: But whenever I run nix-shell from within zsh, I end up with: It works by adding |
Could this possibly be closed after #27493 is closed? |
This is now fixed in Nix 1.12, while for 1.11 there is a PR open at NixOS/nix#1483 |
This issue presents itself if your default shell isn't bash (in my case zsh), and you attempt to use nix-shell. Nix-shell only calls bash from the user's PATH, as is explained here, and bash is expected to have readline support. However, this is not the case if bash is not the default shell - nixos simply ensures pkgs.bash is installed, not necessarily pkgs.bashInteractive. This is a problem because without readline support nix-shell does not behave as expected (notably the prompt is garbled and arrow key functionality is missing). All of these issues were fixed by me including bashInteractive in environment.systemPackages. It would be nice if nixos defaulted to keeping bashInteractive, even if it isn't the user's default shell.
The text was updated successfully, but these errors were encountered: