diff --git a/news/xdgconf.rst b/news/xdgconf.rst new file mode 100644 index 000000000..e5b548944 --- /dev/null +++ b/news/xdgconf.rst @@ -0,0 +1,14 @@ +**Added:** None + +**Changed:** + +* Xonsh run control now also looks for the XDG-compliant file + ``~/.config/xonsh/rc.xsh`` at startup. + +**Deprecated:** None + +**Removed:** None + +**Fixed:** None + +**Security:** None diff --git a/xonsh/environ.py b/xonsh/environ.py index 41865824c..d150f22f3 100644 --- a/xonsh/environ.py +++ b/xonsh/environ.py @@ -247,13 +247,15 @@ def xonshconfig(env): @default_value def default_xonshrc(env): """Creates a new instance of the default xonshrc tuple.""" + xcdrc = os.path.join(xonsh_config_dir(env), 'rc.xsh') if ON_WINDOWS: dxrc = (xonshconfig(env), os.path.join(os_environ['ALLUSERSPROFILE'], 'xonsh', 'xonshrc'), + xcdrc, os.path.expanduser('~/.xonshrc')) else: - dxrc = (xonshconfig(env), '/etc/xonshrc', os.path.expanduser('~/.xonshrc')) + dxrc = (xonshconfig(env), '/etc/xonshrc', xcdrc, os.path.expanduser('~/.xonshrc')) return dxrc @@ -656,9 +658,9 @@ def DEFAULT_DOCS(): 'A list of the locations of run control files, if they exist. User ' 'defined run control file will supersede values set in system-wide ' 'control file if there is a naming collision.', default=( - "On Linux & Mac OSX: ``['/etc/xonshrc', '~/.xonshrc']``\n" + "On Linux & Mac OSX: ``['/etc/xonshrc', '~/.config/xonsh/rc.xsh', '~/.xonshrc']``\n" "\nOn Windows: " - "``['%ALLUSERSPROFILE%\\\\xonsh\\\\xonshrc', '~/.xonshrc']``")), + "``['%ALLUSERSPROFILE%\\\\xonsh\\\\xonshrc', '~/.config/xonsh/rc.xsh', '~/.xonshrc']``")), 'XONSH_APPEND_NEWLINE': VarDocs( 'Append new line when a partial line is preserved in output.' ),