~alva/prompt

My shell prompt
fix `var`nings
add some i18n
move date back to the right side

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.
  • Set terminal title to include the working directory.
  • Communicate working directory to new terminal instances, if supported.
  • Show date/time to the right of the prompt.
  • Show exit code of the last command if not 0.
  • Send a notification when a command completes in a non-focused terminal window.

Color theme can be changed; runtime theming might be supported at some point.

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

Prompt screenshot

#Building/installing

With a recent zig:

# some features are `$SHELL`-specific
zig build -Dshell="$SHELL" --Doptimize=ReleaseSmall -prefix ~/.local

# 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.