diff options
author | Alexander González <alexfertel97@gmail.com> | 2021-08-14 09:29:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 15:29:25 +0200 |
commit | 7038ae2ec871192b6a39f7b03f4ae1e6caecb09b (patch) | |
tree | ea99ded25e3edbe90d45825daa1195275079f9be /docs | |
parent | 91fe1b747f18d00633a9bc6f9766ad09c0a67b97 (diff) |
fix(jobs): Add the symbol and number thresholds respecting the `threshold` option (#2908)
* feat: Add the symbol and number thresholds respecting the threshold option
* fix: Maintain the old behavior + add lots of tests
* docs: Fix the jobs module documentation
Diffstat (limited to 'docs')
-rw-r--r-- | docs/config/README.md | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/docs/config/README.md b/docs/config/README.md index 3fca0de57..cce6a4e14 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -1551,9 +1551,18 @@ symbol = "🌟 " The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. -The module will show the number of jobs running if there is more than 1 job, or -more than the `threshold` config value, if it exists. If `threshold` is set to 0, -then the module will also show when there are 0 jobs running. +The module will show the number of jobs running if there are at least +2 jobs, or more than the `number_threshold` config value, if it exists. +The module will show a symbol if there is at least 1 job, or more than the +`symbol_threshold` config value, if it exists. You can set both values +to 0 in order to *always* show the symbol and number of jobs, even if there are +0 jobs running. + +The default functionality is: + +- 0 jobs -> Nothing is shown. +- 1 job -> `symbol` is shown. +- 2 jobs or more -> `symbol` + `number` are shown. ::: warning @@ -1561,15 +1570,27 @@ This module is not supported on tcsh and nu. ::: +::: warning + +The `threshold` option is deprecated, but if you want to use it, +the module will show the number of jobs running if there is more than 1 job, or +more than the `threshold` config value, if it exists. If `threshold` is set to 0, +then the module will also show when there are 0 jobs running. + +::: + ### Options -| Option | Default | Description | -| ----------- | ----------------------------- | ------------------------------------------------ | -| `threshold` | `1` | Show number of jobs if exceeded. | -| `format` | `"[$symbol$number]($style) "` | The format for the module. | -| `symbol` | `"✦"` | A format string representing the number of jobs. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `jobs` module. | +| Option | Default | Description | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold`\* | `1` | Show number of jobs if exceeded. | +| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. | +| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `jobs` module. | +\*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead. ### Variables @@ -1588,7 +1609,8 @@ This module is not supported on tcsh and nu. [jobs] symbol = "+ " -threshold = 4 +number_threshold = 4 +symbol_threshold = 0 ``` ## Julia |