Open jashandeep-sohi opened 2 weeks ago
What OS are you using? And what is SHELL
set to before nix develop
?
What OS are you using? And what is
SHELL
set to beforenix develop
?
I'm on Archlinux. It's set to /bin/bash
before nix develop
.
But I would hope that this behavior should be independent of the OS, since this is one of main reason for using devenv in the first place.
But I would hope that this behavior should be independent of the OS, since this is one of main reason for using devenv in the first place.
Well, you never know 😄 On Nix-managed systems, you can get stuff like starship working in nix develop
. Lots of opportunity for breakage.
It appears that Nix launches an interactive shell as a QOL improvement, but the SHELL
var remains set to the non-interactive bash builder. mkShell
also adds stdenv
to the shell, so the bash
in PATH
in also non-interactive.
We could set SHELL
to the interactive version in enterShell
and also add bashInteractive
to `packages.
However, in devenv test
, the launched shell is non-interactive. So the above changes would invert the problem there. Not sure what the side-effects would be.
I'm using Flakes to enter devenv shells (i.e. https://devenv.sh/guides/using-with-flake-parts/).
An issue I'm running into is that I'm seeing the following errors whenever tools in the devenv try to do something with a shell:
I think this is because
nix develop
sets$SHELL
to${pkgs.bash}/bin/bash
instead of${pkgs.bashInteractive}/bin/bash
.I can get rid of these errors by explicitly setting
$SHELL
:Which is fine doing it once or twice, but I'm finding it tedious to do for every project I work on.
So the question is, should devenv be setting the
$SHELL
environment variable by default to thebashInteractive
variant of bash? Or is there some other way of avoiding these errors that doesn't require me setting$SHELL
in every devenv?