Home

Awesome

Powerline-hs

Build Status

Powerline-hs is a Powerline clone written in Haskell. It is significantly faster than the original implementation, and makes the shell noticeably more responsive.

Benchmarks

Powerline-hs takes just 79.1 ms to render both prompts, in comparison to Powerline which took 1.25 seconds. (The execution time for a Python Hello World program is included for context.)

Complete benchmark (Click on the graph for an interactive version.)

You can find the source for these benchmarks here, and the Powerline configuration they were run against here. To run the benchmarks, use:

stack bench --benchmark-arguments '--output=bench.html -L 10'

Limitations

Powerline-hs currently only supports shell prompt generation (Bash, ZSH). It does not support the following segments:

Support for other segments and usages may be added on request, time permitting. Pull requests are always welcome.

Installation

You will need to have Powerline installed, since Powerline-hs uses its config files and shell scripts.

You can download a pre-compiled binary from the Releases page - just extract the tarball and you're good to go.

Alternatively, you can compile from source using Stack with:

stack install

Configuration

Powerline-hs is intended to be a drop-in replacement for Powerline. This means that most of Powerline's documentation still applies, and that it should produce the same output without any additional configuration. If it does not, please file a bug.

To try out Powerline-hs in your current shell, just run:

export POWERLINE_COMMAND=$HOME/.local/bin/powerline-hs

(~/.local/bin is the path stack install copies it into - you may need to change it if you placed the executable somewhere else.)

To make it the default, add the following to your shell's RC file (e.g. .zshrc):

POWERLINE_COMMAND=$HOME/.local/bin/powerline-hs
POWERLINE_CONFIG_COMMAND=/bin/true
source /usr/share/zsh/site-contrib/powerline.zsh

The path of the shell script will depend on where you have Powerline installed and which distro you are using.

Git status

Powerline only provides a basic git information segment. There is an implementation here that adds a more advance git status support. Powerline-hs follows powerline-gistatus convention and only provides partial support.

Features supported:

{
  "function": "powerline_gitstatus.gitstatus_ahead",
  "priority": 40
}
{
  "function": "powerline_gitstatus.gitstatus_behind",
  "priority": 40
}
{
  "function": "powerline_gitstatus.gitstatus_staged",
  "priority": 40
}
{
  "function": "powerline_gitstatus.gitstatus_unmerged",
  "priority": 40
}
{
  "function": "powerline_gitstatus.gitstatus_changed",
  "priority": 40
}
{
  "function": "powerline_gitstatus.gitstatus_untracked",
  "priority": 40
}