Skip to main content

Run a default command when you press return on an empty command line.

Project description


This Oh-My-Xonsh plugin for the xonsh shell runs a default command when you press return on an empty command line.

By default, this command will run ls. If $PWD is a git project, it will also run a short git status with git status -s.


You can redefine the defaultcmd function in your rc.xsh to do whatever you want.

For example, if you want a detailed ls and git status, you could do this instead:

def defaultcmd():
    """Run a detailed ls and git status when no other command given"""
    newcmd = "ls -laFG"
    if p'$PWD/.git'.exists():
        newcmd += " && git status"
    return newcmd


Install from PyPI via xpip:

xpip install xontrib-default-command
# or: xpip install -U git+

Then, add this to your rc.xsh:

xontrib load default_command

Similar projects

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xontrib-default-command-0.0.3.tar.gz (2.9 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page