You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ echo'hello\nexit'| nix develop -c bash
Hello, world!
$ echo'hello\nexit'| nix develop
bash: line 1: hello: command not found
$
As you can see, the two commands behave differently. nix develop -c bash allows me to pipe commands into the started shell. This behaves as I would expect it to. nix develop (without -c bash) however doesn't seem to execute the command inside a devShell that is set up correctly. This seems like a bug to me.
Note that piping commands into nix developdoes execute commands inside bash, just not inside the right environment. So the following works as expected:
$ echo'echo foo\nexit'| nix develop
foo
$
Also note that nix develop spawns a bash process with some flags, e.g. bash --rcfile /tmp/nix-shell.zW1tMH. Whereas nix develop -c bash does not. So I'm guessing that's somehow causing the difference in behavior.
Using nix-env (Nix) 2.13.3.
(For me personally, fixing this bug, if it is a bug, doesn't have a high priority. I would be more interested in figuring out why this happens and whether this is in fact a bug or intended behavior.)
Describe the bug
I have the following
flake.nix
file:In I shell I can do this:
As you can see, the two commands behave differently.
nix develop -c bash
allows me to pipe commands into the started shell. This behaves as I would expect it to.nix develop
(without-c bash
) however doesn't seem to execute the command inside adevShell
that is set up correctly. This seems like a bug to me.Note that piping commands into
nix develop
does execute commands insidebash
, just not inside the right environment. So the following works as expected:Also note that
nix develop
spawns a bash process with some flags, e.g.bash --rcfile /tmp/nix-shell.zW1tMH
. Whereasnix develop -c bash
does not. So I'm guessing that's somehow causing the difference in behavior.Using
nix-env (Nix) 2.13.3
.(For me personally, fixing this bug, if it is a bug, doesn't have a high priority. I would be more interested in figuring out why this happens and whether this is in fact a bug or intended behavior.)
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: