~alva/prompt

My shell prompt
Zig updates
Update README to match current `zig build`
Updates for Zig master

refs

trunk
browse  log 

clone

read-only
https://git.sr.ht/~alva/prompt
read/write
git@git.sr.ht:~alva/prompt

You can also use your local clone with git send-email.

#Owl's prompt

Basic prompt that's fairly small and fast. It's about 20 KiB, does not do heap allocation, and has no runtime dependencies (on Linux anyway).

#Features

  • Git tree/index status, with various styles available.
  • Sets terminal title to include the working directory.
  • Communicates working directory to new terminal instances, if supported.
  • Color theme can be changed; runtime theming might be supported at some point.
  • Timestamp can be shown to the right of the prompt.
  • Shows exit code of the last command if not 0.

Run zig build --help to see the available options.

Prompt screenshot

#Building/installing

With a recent zig:

zig build -Doptimize=ReleaseSmall --prefix ~/.local # or elsewhere in your $PATH

# build for zsh instead of bash, which is the default
zig build -Dshell=zsh -Doptimize=ReleaseSmall --prefix ~/.local

You can change the shell and prompt string with build options.

#Usage

In your .bashrc:

PS1="\$(prompt \$?)"

Examples for bash and zsh can be found in contrib.