Colour the reporting commands; split the warnings line - #14
Merged
Conversation
The launch and teardown narration was already colourised while --help, --list, --status, --check-quota and --install-claude beside it printed flat text, so the two halves of the same tool did not look like the same tool. Colour is now decided per stream rather than once at startup. init_colors takes an fd and clears the palette before deciding, so it is re-entrant: the narration asks about stderr, and each reporting command calls init_colors 1 before its first line to ask about stdout. `sinteractive --list | less` then carries no escapes where a plain --list does. SINTERACTIVE_COLOR, NO_COLOR and TERM=dumb are unchanged, and apply to both. Identifiers — job ids, node names — are teal wherever they appear, matching the narration and the status bar. Labels are yellow, secondary text dim, and errors are uniform throughout: a red bold label, the message beside it, and any follow-on hint dimmed under it. Two things now read by colour instead of by parsing: --status shades remaining walltime yellow under an hour and red under fifteen, and job tables mark PENDING yellow against a green RUNNING — which in the job-limit error is the point, since a pending job holds a slot exactly as a running one does. sbatch's own stderr is quoted, not recoloured. The warnings line under the status bar is split, quota flush left and the maintenance-trimmed end time flush right, under the two ends the session line above already uses. Both used to sit at the left with a separator between them, reading as one long run of text with the middle of the line empty; each half now keeps its side whether or not the other is there, so neither moves when its neighbour appears or clears. Both are shorter. The quota notice reports the overage rather than the usage (⚠ QUOTA over by 204.8G (30T limit)) because that is the number to act on, and "over by" already says you are over. The maintenance notice drops its SHORT SESSION label: in yellow, on the warnings line, an end time that is not the one you asked for is already reading as a warning, so the space goes to the reservation name instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Colour
--help,--list,--status,--check-quotaand--install-claudeprinted flat text while the launch and teardown narration beside them was already colourised — the two halves of the same tool didn't look like the same tool.The mechanism needed fixing, not just the call sites.
init_colorsgated on[[ -t 2 ]], but every one of those commands writes to stdout. It now takes an fd and clears the palette before deciding, so it's re-entrant: the narration asks about stderr, each reporting command callsinit_colors 1before its first line to ask about stdout.sinteractive --list | lesscarries no escapes; a plain--listdoes.SINTERACTIVE_COLOR,NO_COLORandTERM=dumbare unchanged and apply to both.Identifiers — job ids, node names — are teal wherever they appear, matching the narration and the status bar. Labels yellow, secondary text dim. Errors are uniform throughout: red bold label, message beside it, follow-on hint dimmed under it. Text sinteractive quotes rather than writes (sbatch's own stderr) is left exactly as sbatch produced it.
Two things now read by colour instead of by parsing:
--statusshades remaining walltime yellow under an hour, red under fifteen minutes.PENDINGyellow against a greenRUNNING. In the job-limit error that's the point — a pending job holds a slot exactly as a running one does.The warnings line
Split: quota flush left, maintenance-trimmed end time flush right, under the two ends the session line above already uses. Both used to sit at the left sharing a
│, reading as one long run of text with the middle of the line empty.Before:
After, at 100 columns:
and at 80, still a 14-space gap:
Each half keeps its side whether or not the other is there, so neither moves when its neighbour appears or clears.
Both are shorter. The quota notice reports the overage rather than the usage — that's the number you act on, and "over by" already says you're over. The maintenance notice drops its
SHORT SESSIONlabel: in yellow, on the warnings line, an end time that isn't the one you asked for already reads as a warning, so the space goes to the reservation name instead.Verification
bash -non all four scripts,shellcheck --severity=warning,groff -ww -zon the man page, JSON check on the settings snippet.NO_COLOR, on underSINTERACTIVE_COLOR=always;--jsonoutput byte-identical on both--statusand--list.skills/bodhi-storage/SKILL.mdis quoted verbatim from--check-quota, so that text is unchanged — only the status-bar notice moved.README, man page, the
bodhi-storageskill and CHANGELOG are updated to match.🤖 Generated with Claude Code