https://github.com/knutwalker/kbashprompt
https://github.com/knutwalker/kbashprompt
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/knutwalker/kbashprompt
- Owner: knutwalker
- License: mit
- Archived: true
- Created: 2020-05-30T12:20:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T04:58:25.000Z (over 3 years ago)
- Last Synced: 2025-01-28T23:38:53.828Z (over 1 year ago)
- Language: Rust
- Size: 82 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# K's bash prompt
Generate PS1 and PS2 prompts for my bash.
```
$ kbashprompt
// outputs $PS1
$ kbashprompt 2
// outputs $PS2
```
## Build
```
make
make install
```
This will put the binary into `/usr/local/bin/`, which can be changed with,
e.g. `PREFIX=/opt make install` to put it in `/opt/bin`.
## Include in .bash_profile
```
# Make sure to keep the single quotes, so that the promp is re-evaluated on every prompt
# Otherwise it would only change if you open a new bash session
export PS1='$(kbashprompt)';
# PS2 is not dynamic, can be calculated once and reused
export PS2=$(kbashprompt 2);
```
## Dependencies
- Requires a terminal with 256 color support (sends `^[[38;5;{ccc}m` ANSI color codes)