A command-line executable that generates a git-aware shell prompt.
Find a file
2019-04-22 16:02:14 +02:00
app Upgrade to GHC 8.0.2 / Stackage lts-9.21 / Turtle 1.3.6 2018-07-12 16:03:43 +02:00
src Move external dependencies into this project 2019-04-22 16:02:14 +02:00
test stack new ps1 2016-08-25 14:46:22 +02:00
.ghci Add .ghci file 2018-07-12 15:06:55 +02:00
.gitignore .gitignore 2016-08-25 14:46:36 +02:00
LICENSE Add real name to LICENSE 2016-08-25 14:46:58 +02:00
ps1.cabal Move external dependencies into this project 2019-04-22 16:02:14 +02:00
ps1.cfg Add ps1.cfg 2016-08-25 14:48:04 +02:00
README.md Upgrade to GHC 8.0.1 / Stackage lts-7.24 2017-08-21 11:23:06 +02:00
Setup.hs stack new ps1 2016-08-25 14:46:22 +02:00
stack.yaml Move external dependencies into this project 2019-04-22 16:02:14 +02:00
TODO.org Update TODO 2016-08-25 15:46:37 +02:00

A git-aware bash prompt

A command-line executable that generates a git-aware bash prompt.

The idea is to extract most of the information you frequently need to get using git status, git log etc. and present it in your prompt.

Build and Install

This will compile and copy ps1 to ~/.local/bin:

stack install

Usage

Ensure that ~/.local/bin is in your path.

Have a look at the options:

ps1 --help

Put something like this in your ~/.bashrc:

PS1='$(ps1 ml)'

Change ml to sl for a single-line prompt

You can add a file called ps1.cfg to any of your git repositories. This allows you to specify another upstream branch to track if needed.

Example contents:

# https://github.com/apauley/ps1#readme
# This tells the prompt to display `Diverged from origin/develop` if needed
track-branch = origin/develop

Build the Executable using Stack within Docker

$ docker run -v ~/.stack:/root/.stack -v ~/.local/bin:/root/.local/bin -v ${PWD}:/ps1 -it --rm haskell:8.0.1 /bin/bash
$ cd /ps1
$ stack config set system-ghc --global true
$ stack install --allow-different-user