Meet Spaceship ZSH v3.0!

Three… Two… One… Liftoff!

Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. Today we’re announcing the third major release of Spaceship prompt — one of the most powerful zsh prompts ever.

Almost a year has passed since A big update of spaceship-zsh-theme and release of v2.0, but now we have even more exciting changes and announcements. So here we go!

What’s new?

The initial purpose of this release was refactoring of how Spaceship works with sections. By the way, there were a few pull-requests with breaking, but important changes. This release brings better API, new options, few performance improvements and more.

Drop Oh-My-Zsh dependency

We’ve run into troubles using built-in functions from Oh-My-Zsh (OMZ). Beside this, a lot of users would like to use Spaceship without OMZ, with their custom setup or with frameworks like prezto. That was the main reason why we decided to remove using OMZ in Spaceship code.

You don’t have to use ZSH_THEME or ZSH_CUSTOM folder anymore to install Spaceship. Since v3.0 we use a native prompt system that comes zsh:

# .zshrc

autoload -U promptinit; promptinit

prompt spaceship

Brand new name

Dropping OMZ means that Spaceship isn’t a theme anymore, it’s a prompt. We’ve renamed our packages and GitHub repository

spaceship-zsh-theme → spaceship-prompt

Old spaceship-zsh-theme npm-package has been deprecated with recommendation to install spaceship-prompt instead.

Better project structure

First of all, project structure has been totally reorganized. Previously, Spaceship was just a huge single source file and any change causes constant jumping between different parts of a single file.

Now Spaceship is split up into smaller modules (sections, utils, etc) and they are loading when it’s required. That also means, if you’re struggling with performance, you can just avoid loading the sections that you don’t use. Read more at “Why is my prompt slow?” section of documentation:

Custom sections and Spaceship API

Brice Dutheil sent us a pull-request with Allow to invoke custom functions. This feature opens an ability to define custom sections with any functionality and, therefore, to extend functionality as much as you need.

Moreover, v3.0 comes with better API for creating sections. To avoid conflicts, Spaceship uses SPACESHIP_ prefix for variables and spaceship:: prefix for a function. All section, including custom ones, are being required to use spaceship_ prefix before their name to load correctly.

Check out Spaceship’s API here:

We encourage you to create your section, as many as you want and share them with others on our External sections wiki-page!

Contributing guidelines

Ability to extend and share sections requires new contributing guidelines, so we’ve finally added a CONTRIBUGING.md file to our repository.

Three simple rules define our development path:

Show only what’s needed. The prompt should not be overloaded, it shows only what user needs at the moment (current directory, git branch, etc).

The prompt should not be overloaded, it shows only what user needs at the moment (current directory, git branch, etc). Work out of the box. The prompt should work right after installation without any additional configuration. Install it and use it.

The prompt should work right after installation without any additional configuration. Install it and use it. Be configurable. It works without configuration, but if a configuration is needed, it provides an easy-to-use interface for customization.

Please, keep this simple rules in mind while you’re contributing to Spaceship.

Right prompt support

The new release brings the support of right prompt ( RPROMPT ). By default right prompt is empty, but you can add some sections the same way you do with a primary prompt.

Spaceship with time section in right prompt

Read the documentation about prompt ordering to learn more:

Website and documentation

We are glad to announce that now Spaceship has a documentation website. We use GitBook for generating this website from our ./docs folder.

Here’s how it looks like: