Spawning a nested bash in a development shell escapes all characters

I don’t know if this is a bug so I’m writing here. Usually my bash shell looks like this:

[fried@nixoshackbrett:~/projects/musicfetch-ng]$

However when spawning a development shell with nix develop and then spawning another bash in that it looks like this:

\[\][\[\]fried@nixoshackbrett:~/projects/musicfetch-ng]$\[\]

Also tab completion and the arrow keys don’t work anymore. This is a bit annoying because I want to use a terminal in neovim and there this problem always occurs.

To reproduce

nix develop "git+https://codeberg.org/Frieder_Hannenheim/musicfetch-ng.git"
# in development shell
bash

That’s usually the symptom of having a non-interactive bash. If you do realpath $(which bash) does the name in the store path say /nix/store/...bash-interactive... or just /nix/store/...bash...?

Oh yeah it’s just bash. How do I use bash interactive?

\[\][\[\]fried@nixoshackbrett:~/projects/musicfetch-ng]$\[\] realpath $(which bash)
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash

The common solution I’ve seen is to put bashInteractive into the packages list in the mkShell expresion.

Yeah that works. It’s kinda annoying that it is not the default.

Yes, it’s a 5.5 year old known issue by now:

1 Like