Skip to content

Commit

Permalink
Add suspended job indicator (#616)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
e-roux and sindresorhus authored Feb 14, 2022
1 parent 67a80dc commit cf00db4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ prompt_pure_preprompt_render() {
# Initialize the preprompt array.
local -a preprompt_parts

# Suspended jobs in background.
if ((${(M)#jobstates:#suspended:*} != 0)); then
preprompt_parts+='%F{$prompt_pure_colors[suspended_jobs]}✦'
fi

# Username and machine, if applicable.
[[ -n $prompt_pure_state[username] ]] && preprompt_parts+=($prompt_pure_state[username])

Expand Down Expand Up @@ -814,6 +819,7 @@ prompt_pure_setup() {
prompt:error red
prompt:success magenta
prompt:continuation 242
suspended_jobs red
user 242
user:root default
virtualenv 242
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Colors can be changed by using [`zstyle`](http://zsh.sourceforge.net/Doc/Release
- `prompt:error` (red) - The `PURE_PROMPT_SYMBOL` when the previous command has *failed*.
- `prompt:success` (magenta) - The `PURE_PROMPT_SYMBOL` when the previous command has *succeeded*.
- `prompt:continuation` (242) - The color for showing the state of the parser in the continuation prompt (PS2). It's the pink part in [this screenshot](https://user-images.githubusercontent.com/147409/70068574-ebc74800-15f8-11ea-84c0-8b94a4b57ff4.png), it appears in the same spot as `virtualenv`. You could for example matching both colors so that Pure has a uniform look.
- `suspended_jobs` (red) - The `` symbol indicates that jobs are running in the background.
- `user` (242) - The username when on remote machine.
- `user:root` (default) - The username when the user is root.
- `virtualenv` (242) - The name of the Python `virtualenv` when in use.
Expand Down

0 comments on commit cf00db4

Please sign in to comment.