Skip to content

Commit d7b6162

Browse files
author
haslersn
committed
Set SHELL variable while in nix-shell
1 parent fd4db2d commit d7b6162

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/any-nix-shell-wrapper

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fns () {
2020
if [[ -n $name ]] && [[ $name != shell ]]; then
2121
pkgs+=" "$name
2222
fi
23-
env ANY_NIX_SHELL_PKGS="$pkgs" nix-shell "$@" --command "$which_shell"
23+
env ANY_NIX_SHELL_PKGS="$pkgs" nix-shell "$@" \
24+
--command "export SHELL=\"$(which $which_shell)\"; $which_shell"
2425
}
2526
fns "$@"

0 commit comments

Comments
 (0)