xonsh/news/xonshrc-env-4394.rst
Gordon Ball 14c2c3ce62
Don't modify XONSHRC and XONSHRC_DIR during startup (#4408)
* xonshrc_context: return loaded instead of context, don't touch env

This function returned the context, but the return value is not used by
the sole call site (and would inconsistently be either the env or ctx
depending on other arguments). Redefine the function to return what was
loaded.

The function will also no longer touch the environment variables
XONSHRC, XONSHRC_DIR or LOADED_RC_FILES.

* XonshSession: add rc_files list, and set in start_services

* LOADED_RC_FILES: drop completely

* xonfig: add RC files

* test_main: update tests for changes to XONSHRC{,_DIR}

* news: add entry for xonshrc changes
2021-08-17 11:01:41 -04:00

30 lines
947 B
ReStructuredText

**Added:**
* <news item>
**Changed:**
* The environment variables ``XONSHRC`` and ``XONSHRC_DIR`` are no longer updated by xonsh on
startup according to which files were actually loaded. This caused problems if xonsh is called
recursively, as the child shells would inherit the modified startup environment of the parent.
These variables will now be left untouched, and the actual RC files loaded (according to those
variables and command line arguments) can be seen in the output of ``xonfig``.
**Deprecated:**
* <news item>
**Removed:**
* The environment variable ``LOADED_RC_FILES`` is no longer set. It contained a list of booleans
as to which RC files had been successfully loaded, but it required knowledge of the RC loading
internals to interpret which status corresponded to which file. As above, the (successfully)
loaded RC files are now shown in ``xonfig``.
**Fixed:**
* <news item>
**Security:**
* <news item>