You can also source .xsh files with import (docs). This requires the xonsh file to be in a directory that is in sys.path, or in the current directory. The above example with import instead looks like this:
@ cd ~/.config/xonsh
@ from rc import *
Finally, if you want to source files written for other shells, there is also source-foreign, and its shortcut aliases like source-bash, which will pull in any changes to environment variables and aliases.
You can source a xonsh file by path with the
sourcebuiltin command, e.g.:will re-source a xonshrc in that location.
You can also source
.xshfiles withimport(docs). This requires the xonsh file to be in a directory that is insys.path, or in the current directory. The above example withimportinstead looks like this:Finally, if you want to source files written for other shells, there is also
source-foreign, and its shortcut aliases likesource-bash, which will pull in any changes to environment variables and aliases.