Home

Awesome

Statusline

Preview

A Powerline-style prompt for prezto and oh-my-zsh

Wish your prompt displayed more information, but afraid of filling it with clutter? Statusline is a responsive zsh theme that provides informational segments when you need them. For example, statusline only displays your user and machine names when you are in a remote shell. Likewise, task runtimes are only shown when they exceed ten seconds, the current working directory is dynamically shortened to fit onscreen, and more! Statusline is designed for solarized (light and dark), and is compatible with the default OS X Terminal.app.

Prerequisites

(The prezto version's installer checks for and installs all prerequisites)

Quick Install

Got/want prezto? Statusline is one line away:

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/el1t/statusline/master/prezto/install)"

For more information, read on!

Features

Single line mode

In addition to a two-line prompt, statusline supports a single-line mode

Single line

Segments

NameDescriptionContext
statusSU/exit code/running jobswhen statuses are present
userusernamewhen in a remote shell
machinemachine namewhen in a remote shell
git-branchbranch/position/commitwhen inside a git repository
git-statusstashed/behind/ahead/etc.when inside a git repository
directorycurrent working directorydynamically truncated
time12-hour clockalways
historyindex in zsh historyalways

Directory truncation?

When the length of the working directory exceeds that of the terminal, subdirectories up to (but not including) the tail directory are shortened to their first letter. In order to use this, directory must be last in the left-hand prompt. Note that only the minimum number of directories necessary are shortened.

Truncation

Prezto

Installation

For automatic installation, simply run this in your shell:

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/el1t/statusline/master/prezto/install)"

Manual installation

Updating

Run this to update prezto and all its submodules (including statusline):

git -C ~/.zprezto submodule foreach git pull origin master && git -C ~/.zprezto submodule foreach "(git checkout master; git pull)&"

Options

Set options in zshrc with zstyle ':prezto:module:prompt' theme 'statusline' <options>

OptionParametersDescription
-c, --colorTerminal color codeSet statusbar background color
-d, --darkN/AApply dark theme
-f, --fontSee belowChange special chars used
-s, --singleN/AFit the prompt to one line
Font ParameterCharacters
powerline⮂   ⮀
legacy◀ < > ▶︎
block◼ | | ◼
noneN/A

Run prompt -h statusline for more information.

Oh-my-zsh

Since the prezto version uses certain prezto modules which are not present in oh-my-zsh, missing features were ported to the oh-my-zsh version. This includes asynchronous git status loading, which was ported from prezto's git-info, and the customizable settings. However, statusline's settings are not exposed by oh-my-zsh, so customization is more difficult. Also, the key-binding color indicator is currently not supported in this version.