Skip to content

Commit 568027d

Browse files
authored
add wsh badge documentation (#3031)
1 parent e3c46b7 commit 568027d

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

docs/docs/wsh-reference.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title: "wsh reference"
66

77
import { Kbd } from "@site/src/components/kbd";
88
import { PlatformProvider, PlatformSelectorButton } from "@site/src/components/platformcontext";
9+
import { VersionBadge } from "@site/src/components/versionbadge";
910

1011
<PlatformProvider>
1112

@@ -262,6 +263,57 @@ Use `--print` to preview the metadata for any background configuration without a
262263
263264
---
264265
266+
## badge <VersionBadge version="v0.14.2" />
267+
268+
The `badge` command sets or clears a visual badge indicator on a block or tab header.
269+
270+
```sh
271+
wsh badge [icon]
272+
wsh badge --clear
273+
```
274+
275+
Badges are used to draw attention to a block or tab, such as indicating a process has completed or needs attention. If no icon is provided, it defaults to `circle-small`. Icon names are [Font Awesome](https://fontawesome.com/icons) icon names (without the `fa-` prefix).
276+
277+
Flags:
278+
279+
- `--color string` - set the badge color (CSS color name or hex)
280+
- `--priority float` - set the badge priority (default 10; higher priority badges take precedence)
281+
- `--clear` - remove the badge from the block or tab
282+
- `--beep` - play the system bell sound when setting the badge
283+
- `--pid int` - watch a PID and automatically clear the badge when it exits (sets default priority to 5)
284+
- `-b, --block` - target a specific block or tab (same format as `getmeta`)
285+
286+
Examples:
287+
288+
```sh
289+
# Set a default badge on the current block
290+
wsh badge
291+
292+
# Set a badge with a custom icon and color
293+
wsh badge circle-check --color green
294+
295+
# Set a high-priority badge on a specific block
296+
wsh badge triangle-exclamation --color red --priority 20 -b 2
297+
298+
# Set a badge that clears when a process exits
299+
wsh badge --pid 12345
300+
301+
# Play the bell and set a badge when done
302+
wsh badge circle-check --beep
303+
304+
# Clear the badge on the current block
305+
wsh badge --clear
306+
307+
# Clear the badge on a specific tab
308+
wsh badge --clear -b tab
309+
```
310+
311+
:::note
312+
The `--pid` flag is not supported on Windows.
313+
:::
314+
315+
---
316+
265317
## run
266318
267319
The `run` command creates a new terminal command block and executes a specified command within it. The command can be provided either as arguments after `--` or using the `-c` flag. Unless the `-x` or `-X` flags are passed, commands can be re-executed by pressing `Enter` once the command has finished running.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)