Fix: don't display welcome if $XONSHRC_DIR member is found (#4531)

* Fix: don't display welcome if $XONSHRC_DIR member is found

* Docs: add news item

* Update news/fix-xonshrc-dir-welcome.rst

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

* Lint: black

* Update news/fix-xonshrc-dir-welcome.rst

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
This commit is contained in:
Angus Hollands 2021-11-18 17:42:29 +00:00 committed by GitHub
parent 337cf25a40
commit 99bdf5600a
Failed to generate hash of commit
2 changed files with 27 additions and 2 deletions

View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Do not show welcome message when any ``$XONSHRC_DIR`` directory entry exists.
**Security:**
* <news item>

View file

@ -464,8 +464,10 @@ def main_xonsh(args):
env["XONSH_INTERACTIVE"] = True
ignore_sigtstp()
if env["XONSH_INTERACTIVE"] and not any(
os.path.isfile(i) for i in env["XONSHRC"]
if (
env["XONSH_INTERACTIVE"]
and not any(os.path.isfile(i) for i in env["XONSHRC"])
and not any(os.path.isdir(i) for i in env["XONSHRC_DIR"])
):
print_welcome_screen()
events.on_pre_cmdloop.fire()