From bb0fc5792f6cc98d2a65bd009b05cfbb0812a3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 15 Oct 2020 01:46:26 +0200 Subject: [PATCH] don't override SHELL this variable might be useful in direnv to expose different behavior depending on calling shell. fixes https://github.com/nix-community/nix-direnv/issues/45 --- direnvrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direnvrc b/direnvrc index b8fbf94..aa70126 100644 --- a/direnvrc +++ b/direnvrc @@ -14,6 +14,7 @@ _nix_import_env() { local old_path=${PATH:-} local old_term=${TERM:-__UNSET__} + local old_shell=${SHELL:-__UNSET__} local old_tmpdir=${TMPDIR:-__UNSET__} local old_ssl_cert_file=${SSL_CERT_FILE:-__UNSET__} local old_nix_ssl_cert_file=${NIX_SSL_CERT_FILE:-__UNSET__} @@ -30,8 +31,9 @@ _nix_import_env() { fi export PATH=$PATH${old_path:+":"}$old_path - _nix_export_or_unset TEMPDIR "$old_tmpdir" _nix_export_or_unset TERM "$old_term" + _nix_export_or_unset SHELL "$old_shell" + _nix_export_or_unset TEMPDIR "$old_tmpdir" # misleading since we are in an impure shell now export IN_NIX_SHELL=impure