Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eliahkagan/pipestatus
Put the last command's exit status(es) in your Bash prompt
https://github.com/eliahkagan/pipestatus
Last synced: about 24 hours ago
JSON representation
Put the last command's exit status(es) in your Bash prompt
- Host: GitHub
- URL: https://github.com/eliahkagan/pipestatus
- Owner: EliahKagan
- License: 0bsd
- Created: 2024-04-25T01:23:07.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-25T01:27:52.000Z (7 months ago)
- Last Synced: 2024-04-25T02:38:42.649Z (7 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pipestatus - exit status(es) in Bash prompt
This puts the exit status of the last command, or all of its exit statuses if
it was a pipeline of multiple commands, into your Bash prompt. They are shown
if the command reported failure (i.e., had a nonzero exit status), or if any
command in the pipeline did.To install, put `~/.pipestatus.bash` in your home directory, and add this code
at (or near) the end of your `~/.bashrc` file:```bash
# add information to the prompt about nonzero exit statuses
. ~/.pipestatus.bash
```This named after the Bash
[`PIPESTATUS`](https://www.gnu.org/software/bash/manual/bash.html#index-PIPESTATUS)
array variable that it makes use of.## License
[0BSD](https://spdx.org/licenses/0BSD.html). See [**`LICENSE`**](LICENSE).
## History
This was written back in 2023 but I didn't get around to publishing it widely
until mid-2024, when a bug (that `\[` and `\]` were not used to help the shell
correcty compute how many columns the prompt takes up in the terminal) was
fixed.I think the positioning and styling is inspired by the way the defualt `fish`
prompt includes this information, but I am not sure.