Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willeccles/promptus
🌵 Very quick shell prompt that supports multiple shells.
https://github.com/willeccles/promptus
bash bash-prompt c cactus shell-prompt zsh zsh-prompt
Last synced: 25 days ago
JSON representation
🌵 Very quick shell prompt that supports multiple shells.
- Host: GitHub
- URL: https://github.com/willeccles/promptus
- Owner: willeccles
- License: mit
- Created: 2020-08-13T14:48:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T13:44:26.000Z (8 months ago)
- Last Synced: 2024-05-01T13:50:32.735Z (about 1 month ago)
- Topics: bash, bash-prompt, c, cactus, shell-prompt, zsh, zsh-prompt
- Language: C
- Homepage:
- Size: 19.5 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-ricing - Promptus - Very quick shell prompt that supports multiple shells. (C) (Packages / Prompts)
- awesome-zsh-plugins - promptus - Simple, minimalist and configurable shell prompt program in C which can be used to make your prompt the same on any shell. Includes exit code and working directory decorations. (Themes / ZSH on Windows)
- fucking-awesome-zsh-plugins - promptus - Simple, minimalist and configurable shell prompt program in C which can be used to make your prompt the same on any shell. Includes exit code and working directory decorations. (Themes / ZSH on Windows)
- awesome-zsh-plugins - promptus - Simple, minimalist and configurable shell prompt program in C which can be used to make your prompt the same on any shell. Includes exit code and working directory decorations. (Themes / ZSH on Windows)
README
# Promptus
Simple and configurable shell prompt program in C which can be used to make your
prompt the same on any shell.![preview of promptus](/preview.png)
## Features
Promptus is very simple, but has some convenience features for those who want
them:- Display of the PWD (enabled by default)
- Basename of PWD (enabled by default)
- Abbreviation of `$HOME` to `~` (enabled by default)
- Coloring of prompt based on exit code of previous program (enabled by default)
- Customizable color set
- Python venv prefix support## Configuration
See config.h for configuration options.
## Building
Modify config.h to suit your needs and then do `make`. Use `make install` to
install and `make uninstall` to uninstall.## Usage
Simply running promptus is enough. If `PROMPT_STATUS` is enabled in config.h,
pass the exit code of the previous process as the first argument (or don't,
which allows you to disable this feature at runtime without rebuilding
promptus).### Bash
If you are using bash and want to use promptus for your prompt, this is how
I would do it. Put this in your .bashrc:```bash
export PROMPT_COMMAND=__prompt_commandif command -v promptus >/dev/null; then
__prompt_command() { PS1="$(promptus $?)" }
else
__prompt_command() {
# if you have a default prompt you'd like to use when promptus isn't
# installed, you should set PS1 here
}
fi
```### Zsh
If you are using zsh, things are a little weirder than bash, but work about the
same way. Try this:```zsh
if command -v promptus >/dev/null; then
precmd() { PROMPT="$(eval 'promptus $?')" }
fi# this won't get used if promptus is found above
export PROMPT="my cool prompt $ "
```