nix-shell --pure: Keep the user's $PAGER

This commit is contained in:
Eelco Dolstra 2014-04-08 14:08:57 +02:00
parent 76cbf55a6d
commit 2b6c8ef401

View file

@ -208,7 +208,7 @@ foreach my $expr (@exprs) {
# Set the environment. # Set the environment.
if ($pure) { if ($pure) {
foreach my $name (keys %ENV) { foreach my $name (keys %ENV) {
next if grep { $_ eq $name } ("HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ"); next if grep { $_ eq $name } ("HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER");
delete $ENV{$name}; delete $ENV{$name};
} }
# NixOS hack: prevent /etc/bashrc from sourcing /etc/profile. # NixOS hack: prevent /etc/bashrc from sourcing /etc/profile.