https://github.com/juhp/bash-color-prompt
User customizable Bash prompt
https://github.com/juhp/bash-color-prompt
bash-prompt
Last synced: 2 months ago
JSON representation
User customizable Bash prompt
- Host: GitHub
- URL: https://github.com/juhp/bash-color-prompt
- Owner: juhp
- License: gpl-3.0
- Created: 2026-01-04T11:57:05.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-14T11:10:05.000Z (5 months ago)
- Last Synced: 2026-01-14T15:22:37.966Z (5 months ago)
- Topics: bash-prompt
- Language: Shell
- Homepage: https://copr.fedorainfracloud.org/coprs/petersen/bash-color-prompt/
- Size: 66.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: COPYING
Awesome Lists containing this project
README
# Bash Color Prompt (bcp)
This is intended to become a replacement or follow on to
Fedora's [bash-color-prompt](https://src.fedoraproject.org/rpms/shell-color-prompt) package with a cleaner declarative builder pattern approach,
which makes it easy for users to create clean highly customized bash prompts.
## Basic setup
Add:
```bash
source bash-color-prompt.sh
bcp_init
```
to `~/.bashrc`.
`bcp_init()` sets up `PROMPT_COMMAND` to build `PS1`.
By default it uses the `_bcp_default_layout()` configuration,
which gives a green bold prompt: `user@localhost:~$ `,
with the same appearance as the current default Fedora prompt.
It could be made to support default prompts for other OS's later perhaps.
## Configuration
Users can optionally define `bcp_layout()` to specify
a custom prompt using `bpc_append`, etc, to their liking.
See [example.bashrc.sh](https://github.com/juhp/bash-color-prompt/blob/main/example.bashrc.sh) for a custom example.
## Try it
Before adding to your `bashrc`, you can test it out in bash with just:
`source example.bashrc.sh`
(or `source bash-color-prompt.sh` and then `bcp_init`).
Note that bcp's functions may still be subject to change at this time.
## Help and Contribute
Please open an issue in .
bash-color-prompt is distributed under the GPL license version 3 or later.