Xonsh "is a Python-powered shell"
-
to install on Linux:
# on Ubuntu sudo apt install xonsh # on Arch Linux/Manjaro yay -S xonsh
-
If installing on WSL make sure that you add the code below is added to the wsl config file that can be opened in VSCode using the following command:
code ~/.wslconfig[interop] appendWindowsPath=false -
to set as default shell see below or this url
# First ensure that xonsh is on your $PATH which xonsh # Then, as root, add xonsh to the shell list (this may fail not sure why) sudo which xonsh >> /etc/shells # To change shells, run chsh -s $(which xonsh) # You will have to log out and log back in before the changes take effect. # then you can run the setup wizard xonfig wizard # to load the xonsh config file using VSCode code ~/.xonshrc
-
You should install pyenv-win first more details about how to do that can be found here
- You can then install python and set a global python version to use to install Xonsh (commands for this are below)
- You will also need to disable the python app alias in Windows you can do that by searching for "Manage app execution aliases" then deselect the two python aliases. More details can be found here on stackoverflow
# install python version 3.10.8 (in this example) pyenv install 3.10.8 # set this version of python as the global default version of python pyenv global 3.10.8 # install xonsh using pipx # upgrade pip python -m pip install --upgrade pip
- Install xonsh
pip install xonsh[full]- To install xonsh using pipx see below. I do not recommend this as of 2022-11-18 on windows due to some subprocess mode issues (issue 4566 issue 4886).
# install pipx pip install pipx pipx install 'xonsh[full]' # you may then have to restart your shell pipx runpip xonsh install readline
- Vox comes with Xonsh and is used for managing virtual environments
-
To setup Xonsh do the following
# launch xonsh xonsh # create the `.xonshrc` file using VSCode (and open it in) cd ~ && code .xonshrc # to setup the xonfig file using the web use this command (I've never really got it to work well) xonfig web