Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bimlas/bash-jobs-prompt
Bash: Shell prompt component for displaying background jobs
https://github.com/bimlas/bash-jobs-prompt
bash cli command-line prompt terminal zsh
Last synced: 27 days ago
JSON representation
Bash: Shell prompt component for displaying background jobs
- Host: GitHub
- URL: https://github.com/bimlas/bash-jobs-prompt
- Owner: bimlas
- License: mit
- Created: 2021-05-27T21:22:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-04T14:48:23.000Z (about 1 year ago)
- Last Synced: 2024-11-17T23:25:43.133Z (3 months ago)
- Topics: bash, cli, command-line, prompt, terminal, zsh
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jobs prompt: Shell prompt component for displaying background jobs
If you frequently use the `Ctrl + Z` shortcut in Bash or Zsh shells to send a
process to the background, it can be useful to see the list of jobs
continuously without having to query it with the `jobs` command.[See the screencast on YouTube](https://youtu.be/EtlsE53qG9U)
## Installation
Download the `bin/jobs_prompt` script and place it somewhere on your PATH or use
[Basher](https://github.com/basherpm/basher).Get the source code, report bugs, open pull requests, or just star because
you didn't know that you need it:* https://github.com/bimlas/bash-jobs-prompt
## Usage
At the desired part of the prompt, call the script by sending the output of `jobs` to it.
```
PS1+='$(jobs | jobs_prompt)'
```If you also want to add surrounding text that only appears if there are jobs,
you can use the following solution.```
PS1+='$('
PS1+='jobs'
PS1+='| jobs_prompt'
PS1+='| sed "s/.\\+/\\n Jobs: & \\n/"'
PS1+=')'
```## Configuration
You can change the color of the prompt sections with environment variables.
* `JOBS_PROMPT_RED`
* The color of stopped / suspended processes
* `JOBS_PROMPT_GREEN`
* The color of running processes
* `JOBS_PROMPT_TEXT`
* The color of job numbers