Skip to content

Latest commit

 

History

206 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

powerbash

A powerline-style bash prompt in pure bash — one script, no dependencies, no patched fonts.

CI License: MIT

 napalm  powerbash  » updates +  $

Segments, in display order: virtual environment, username, hostname, path, git branch and state, background job count, $/# symbol, and the return code of the last command. Everything is toggled at runtime with the powerbash command and persisted to a small config file.

Full documentation: powerbash.org/docs

Install

powerbash installs into your own account. It does not need root, and a per-user install is the recommended way to run it.

Homebrew — recommended

brew install powerbash/powerbash/powerbash

Then add the line the caveats print to ~/.bashrc (Linux) or ~/.bash_profile (macOS). Upgrades come along with the rest of your brew upgrade, which is why this is the path to prefer where you have it.

Install script

For machines without Homebrew.

curl -s https://get.powerbash.org | bash

Downloads the script to ~/.local/share/powerbash/ and wires it into your shell startup file. Re-run it any time to upgrade. To remove it:

curl -s https://get.powerbash.org | bash -s -- uninstall

Manual

mkdir -p ~/.local/share/powerbash
curl -Ls https://download.powerbash.org/powerbash.sh -o ~/.local/share/powerbash/powerbash.sh
echo 'source ~/.local/share/powerbash/powerbash.sh' >> ~/.bashrc

On macOS use ~/.bash_profile — Terminal.app and iTerm2 start login shells.

A multi-user install into /etc/profile.d/ is still possible but discouraged; see the docs for why and how.

Usage

powerbash help            # every subcommand, also available via [tab]
powerbash path parted     # /full/.../no/where
powerbash git timeout 1   # give up on slow git repos after a second
powerbash config save     # persist the current settings

Requirements

  • bash 3.2 or newer — including the /bin/bash that ships with macOS.
  • A UTF-8 locale, for the », , , and glyphs.
  • tput for colors and git for the git segment. Both optional: powerbash degrades to a plain prompt without them.

Runs on Linux, macOS, and WSL.

Development

make                # list every target
make check          # lint, the suite, and the suite under bash 3.2
make toolbox        # build the dev container (one time)
make shell          # a shell in it, running the working copy of the prompt

tests/smoke.sh also runs on its own — it has to, since it runs inside a bash 3.2 container with no make in it. CI calls the same targets.

See AGENTS.md for the architecture and the constraints that shape the script.

License

MIT — see LICENSE.

About

powerline-style bash prompt in pure bash script

Topics

Resources

Stars

19 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages