Skip to content
Snippets Groups Projects
Commit 4ea034a5 authored by Shea Levy's avatar Shea Levy Committed by Eelco Dolstra
Browse files

nix-shell: Play nicely with non-interactive shells


nix-shell with the --command flag might be used non-interactively, but
if bash starts non-interactively (i.e. with stdin or stderr not a
terminal), it won't source the script given in --rcfile. However, in
that case it *will* source the script found in $BASH_ENV, so we can use
that instead.

Also, don't source ~/.bashrc in a non-interactive shell (detectable by
checking the PS1 env var)

Signed-off-by: default avatarShea Levy <shea@shealevy.com>
parent 792fd51f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment