Repository navigation
setup: plain-text help/non-tty banner (#195); warn on hand-written rc theme (#196) - #229
Merged
Merged
Conversation
…rc theme (#196) #195: `niu setup --help`/`-h` now answers with a plain-text usage block instead of running the wizard, and the non-tty wizard banner (pipes, redirects, CI) drops the ANSI pixel-art logo while keeping the welcome text. On a tty the art is unchanged. #196: the supported theme channel is the `theme` field of a `[[sources]]` entry in `~/.niubash/plugins.toml`; a hand-written `export OSH_THEME=...` line in the rc is shadowed/dropped when sync rewrites the managed blocks. `niu plugin sync` now detects stray hand-written theme assignments outside the managed blocks and prints a one-shot stderr warning pointing at the spec (startup `--bootstrap` form stays silent). READMEs and docs/plugins-guide.md gain a "Setting the theme correctly" note. Closes #195, closes #196. Tests: tests/issue195_setup_help_plain.rs (3 asserts, all no-ESC), unit test for the stray scan, existing setup/sync suites green.
caomengxuan666
added a commit
that referenced
this pull request
Oct 10, 2026
- Delete docs/eco-harvest-resume-wt97b.md: point-in-time lane resume/handoff snapshot; the harvest/test line now runs on GitHub Actions (eco-harvest-ci.yml) and the diagnosis lives in git history. - CHANGELOG: add Unreleased entries for strip (#228), setup help/non-tty banner (#229), bundled niugit/ripgrep/fd + setup detection (#230/#231), PROMPT_COMMAND exit jump (#232), PS0 stderr (#233), bracketed paste (#234). Co-authored-by: docs-audit <[email protected]>
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.
Summary
One PR closes two P3 issues.
#195 —
niu setup --helpprinted raw ANSI art on non-tty stdoutniu setup --help/-hnow answers with a plain-text usage block and exits, instead of launching the wizard (on a tty or off one — help is always readable).niu setup,niu setup --preset ...in pipes/CI) now checksstdoutis_terminal(): on a tty the ANSI pixel-art logo is unchanged; when stdout is not a terminal the banner degrades to plain text (same welcome content, zero escape sequences).#196 — theme belongs in
plugins.toml, not a hand-writtenOSH_THEMEin the rcniu plugin syncnow detects a hand-writtenOSH_THEME=/BASH_IT_THEME=(exportoptional) assignment outside the managed marker blocks and prints a one-shot stderr warning pointing at~/.niubash/plugins.toml(theme = "..."on the source entry). The startup--bootstrapform stays silent, so shell boots are not nagged.README.mdandREADME-zh.md, plus a warning note at thethemefield docs indocs/plugins-guide.md.Test plan
tests/issue195_setup_help_plain.rs:setup --help/-houtput contains no ANSI escapes; piped non-interactiveniu setupoutput contains no ANSI escapes and still completes the wizard — all pass.stray_theme_scan_sees_only_lines_outside_managed_blocksinplugins/assets.rs— passes.plugin_sources,plugin_assets,plugin_spec_sync,startup_files,smoke_1_3_0(setup wizard journey included).cargo fmtclean.niu plugin syncwith a strayexport OSH_THEME=agnosterrc line prints the new warning and points at the spec.closes #195
closes #196