Fix nushell completion path; adopt shared install helpers - #191
Merged
Conversation
install_completions.py wrote nushell completions to $XDG_CONFIG_HOME/nushell/autoload. On Windows $nu.user-autoload-dirs is exactly %APPDATA%\nushell\autoload and nushell never reads the XDG path, so the helper wrote a real file somewhere nothing consults, printed the path, and delivered nothing. Two more defects in the same helper: it logged a generation failure to stderr, continued, and then printed "Installed completions for retch:" unconditionally -- success reported over work not done; and nothing checked whether zsh would ever load the file (it reads only directories on fpath, and site-functions is not on it by default). It now checks, via an INTERACTIVE zsh, since a non-interactive one reports the built-in default. This repo's MECHANISM was right and is now the standard. v0.6.16 moved these recipes to Python so they run natively on Windows without Git's usr\bin; rusticprofile first proposed replacing them with sh recipes because it held the correctness fixes, which would have regressed that work in the name of consistency. Each repo had solved half the problem. install_completions.py and install_man.py are now vendored byte-identically across retch, rusticprofile and etr, with templates/justfile-common.just as the Justfile block reference. standard-check runs their self-tests -- not a text diff, since separate repos cannot diff each other's files and a diff would pass on a repo that never adopted the standard -- and check depends on it. Also adds install-tag VERSION, which installs a released tag with binary, completions (from the INSTALLED binary) and man page (from the tag) so the three cannot disagree. Assisted-By: Claude Opus 5
This was referenced Aug 13, 2026
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.
Description
The bug:
scripts/install_completions.pywrote nushell completions to$XDG_CONFIG_HOME/nushell/autoload. On Windows$nu.user-autoload-dirsis exactly%APPDATA%\nushell\autoload— one entry — and nushell there never reads the XDG path, whateverXDG_CONFIG_HOMEsays. So the helper wrote a real file to a directory nothing consults, printedthat path, and delivered nothing. Measured in
rusticprofile(its0.2.14), where the same defectexplained shell aliases missing for months while present in the dotfiles the whole time.
Two more in the same helper. It logged a generation failure to stderr, continued, and then ran
print("Installed completions for retch:")plus the full path list unconditionally — successreported over work not done. And nothing checked whether zsh would ever load the file; it now asks
an interactive zsh, because a non-interactive one sources neither
.zshrcnor anything itincludes and so returns the built-in
fpath, getting the answer wrong just as confidently.This repo's mechanism was right, and is now the standard
v0.6.16moved these recipes to Python so they run natively on Windows without Git'susr\bin.rusticprofilefirst proposed replacing them with plain-shrecipes because it held thecorrectness fixes — which would have regressed that portability work in the name of consistency.
Each repo had solved half the problem. The shared standard keeps retch's mechanism and
rusticprofile's correctness.
scripts/install_completions.py,scripts/install_man.pyandtemplates/justfile-common.justarenow vendored byte-identically across
retch,rusticprofileandetr(TEMPLATE_VERSION = 2).Project facts (
BINS,MAN_PAGES) sit in aPROJECTheader above the marked block, becauseetrships two binaries and a block with a hardcoded name cannot be copied.
just standard-checkruns the helpers'--self-test;just checkdepends on it. Not a textdiff — three separate repos cannot diff each other's files, and a diff would pass happily on a repo
that never adopted the standard.
Also:
install-tag VERSIONInstalls a released tag with all three artefacts from that tag: binary via
cargo install --git --tag, completions from the installed binary so they cannot disagree with its CLI, man page fromthe tag via
git show. It deliberately does not depend oninstall-man/install-completions, whichwork from the checkout — reusing them would pair a tag's binary with the worktree's man page.
Prompted by a fleet host found running a current binary beside a man page eleven releases old.
Type of change
How Has This Been Tested?
just prgreen: fmt, clippy--workspaceand--features graphics, 69 + 114 + 15 tests,man regen at
retch 0.6.20, audit advisory-only.nushell line reports
windows nushell dir: expected …AppData\Roaming… got …/.config/….Dropping a shell and treating an empty XDG variable as a location also fail.
$?fromheadand reportedexit 0on a failing self-test.Installedline (verified with a bad binary name).HEAD: exactly two additions (install-tag,standard-check), noneremoved.
just --listparses.rusticprofile's copies.Backup safety
n/a — tooling only; no repository or filesystem writes beyond the completion/man install paths.
Checklist:
(
Development-Setup.md,7fc584f..03796ba)just manre-run after the bump and committedsuccess, and
standard-checkfails the build on a violation