the xonsh shell¶
~
~
Xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.5+ with additional shell primitives that you are used to from Bash and IPython. It works on all major systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily use of experts and novices alike.
Installation¶
Prerequisites¶
python V3.6 or later.
for interactive use, an ansi (vt100-compatible) terminal application. On Windows 10, the separately-installable Windows Terminal app is recommended.
Installation¶
Xonsh can be installed via package manager, via appimage or just run from a pre-built container:
Configuration and Customization¶
Xonsh uses startup configuration files and provides configuration wizards to help you set them up.
Comparison¶
Xonsh is significantly different from most other shells or shell tools. The following table lists features and capabilities that various tools may or may not share.
Bash |
zsh |
plumbum |
fish |
IPython |
xonsh |
|
---|---|---|---|---|---|---|
Sane language |
✓ |
✓ |
✓ |
✓ |
||
Easily scriptable |
✓ |
✓ |
✓ |
✓ |
✓ |
|
Native cross-platform support |
✓ |
✓ |
✓ |
✓ |
||
Meant as a shell |
✓ |
✓ |
✓ |
✓ |
||
Tab completion |
✓ |
✓ |
✓ |
✓ |
✓ |
|
Completion from man-page parsing |
✓ |
✓ |
||||
Large standard library |
✓ |
✓ |
✓ |
|||
Typed variables |
✓ |
✓ |
✓ |
✓ |
||
Syntax highlighting |
✓ |
in notebook |
w/ prompt-toolkit |
|||
Pun in name |
✓ |
✓ |
✓ |
|||
Rich history |
✓ |
Guides¶
- Tutorial
- Tutorial: History
- Tutorial: Macros
- Tutorial: Extensions (Xontribs)
- Tutorial: Xonsh Projects
- Tutorial: Events
- Tutorial: Programmable Tab-Completion
- Tutorial: Write Your Own History Backend
- Tutorial: Subprocess Strings
- Tutorial:
prompt_toolkit
custom keybindings - Bash to Xonsh Translation Guide
- Subprocess Types Table
- Python Virtual Environments
- Keyboard Shortcuts
Config Files and Settings¶
News & Media¶
Contributing¶
We highly encourage contributions to xonsh! If you would like to contribute, it is as easy as forking the repository on GitHub, making your changes, and issuing a pull request. If you have any questions about this process don’t hesitate to ask the mailing list (xonsh@googlegroups.com) or the Gitter channel.
See the Developer’s Guide for more information about contributing.
Contact Us¶
If you have questions or comments, please send them to the mailing list xonsh@googlegroups.com, page us on IRC, contact the author directly, or open an issue on GitHub. Join the mailing list here!
Development Spiral¶
- Xonsh API
- Xonsh Standard Library
- Lexer (
xonsh.lexer
) - Parser (
xonsh.parser
) - Abstract Syntax Tree (
xonsh.ast
) - Compilation, Evaluation, & Execution (
xonsh.execer
) - Import Hooks (
xonsh.imphooks
) - Built-Ins (
xonsh.built_ins
) - Environment (
xonsh.environ
) - Aliases (
xonsh.aliases
) - Directory Stack (
xonsh.dirstack
) - Job Control (
xonsh.jobs
) - Python Procedures as Subprocess Commands (
xonsh.proc
) - Object Inspectors (
xonsh.inspectors
) - Xonsh History API
- Tab Completer (
xonsh.completer
) - Completers API
- Prompt formatter API
- Main Shell Command Prompt (
xonsh.shell
) - Base Shell Class (
xonsh.base_shell
) - Readline Shell (
xonsh.readline_shell
) - Prompt Toolkit 2+ Shell (
xonsh.ptk_shell.shell
) - Prompt Toolkit 2+ History Object (
xonsh.ptk_shell.history
) - Prompt Toolkit 2+ Completer (
xonsh.ptk_shell.completer
) - Prompt Toolkit 2+ Key Bindings (
xonsh.ptk_shell.key_bindings
) - Pretty printing (
xonsh.pretty
) - History Diff’er (
xonsh.diff_history
) - Core Utilities API
- Events (
xonsh.events
) - Tools (
xonsh.tools
) - Platform-specific constants and implementations (
xonsh.platform
) - JSON Utilities (
xonsh.jsonutils
) - Lazy JSON Files (
xonsh.lazyjson
) - Lazy & Self-destructive Objects (
xonsh.lazyasd
) - Open Python Files (
xonsh.openpy
) - Foreign Shell Tools (
xonsh.foreign_shells
) - Commands Cache (
xonsh.commands_cache
) - Tracer (
xonsh.tracer
) - Command Line Interface (
xonsh.main
) - Color Tools (
xonsh.color_tools
) - Pygments Hooks (
xonsh.pyghooks
) - Jupyter Kernel (
xonsh.jupyter_kernel
) - Jupyter Shell (
xonsh.jupyter_shell
) - Dumb Shell (
xonsh.dumb_shell
) - Wizard Making Tools (
xonsh.wizard
) - Xonsh Configuration Utility (
xonsh.xonfig
) - Compiling and Caching of Xonsh Code (
xonsh.codecache
) - Context Managers for Xonsh (
xonsh.contexts
) - Matplotlib Hooks (
xontrib.mplhooks
) - Vox (
xontrib.voxapi
)
- Advanced Events
- Developer’s Guide
- Xonsh Change Log
- Frequently Asked Questions
- Wishlist & To-Dos