Skip to main content

Module ui

Module ui 

Source
Expand description

How pxh talks to a human.

Every diagnostic line pxh prints – as opposed to history rows, JSON, or shell-config text, which are data – goes through here, so a message’s severity is a named thing rather than a prefix typed at the call site.

Styling is always emitted by render; whether it survives is the sink’s decision. The sinks print through anstream, which strips ANSI when stderr is not a terminal and honors NO_COLOR, CLICOLOR, CLICOLOR_FORCE, and TERM=dumb. stdout is reserved for data and is never written from here.

Modules§

sgr
The palette. Nothing outside this module spells an SGR sequence.

Enums§

Level
What a message is. Decides the color and the leading word.

Functions§

count
1 secret / 3 secrets – every counted noun pxh prints goes through here, so nothing says secret(s). Nouns pluralize with a plain s; that is true of everything pxh counts (secret, issue, entry, command, day, hour).
emit 🔒
error
The command failed. Rendered error: <text>.
hint
A suggestion: hint: run pxh maintenance to reclaim disk space.
render 🔒
Render one message: <word>: <text>, colored. Pure, so the vocabulary is testable without a terminal.
warn
Something is wrong; the command continues.