fix(fish-deps): show real binary path + drop hardcoded /usr/bin in paru/yay wrappers #62
Reference in New Issue
Block a user
Delete Branch "fish-deps-real-binary-resolution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two related fixes around the paru/yay PTY-logging wrappers (which live in
~/.local/binand shadow the real binaries on PATH):~/.local/bin/paru(our shim) as the install location instead of the real binary./usr/bin/{paru,yay}— both for the presence check and as the command they shell out to. On any host where paru/yay live elsewhere, the generated wrapper would call a nonexistent path.Both now share one resolver.
Commits
feat(fish-deps)— addfunctions/__fish_real_command.fish: walks every PATH match for a name and returns the first that is not one of our generated wrappers, identified by the# <name>-wrapper-version:marker (grep -qsIF;-Imakes real ELF binaries count as no-match, so only our text shims are skipped). It never returns one of our own wrappers, so a caller embedding the result can't create a shim that recurses into itself. Wire it into the fish-deps status(Found at …)path.fix(paru/yay-wrapper)— resolve the real binary via__fish_real_command(skipping our shim) for both the presence check and the embeddedcmd_str, instead of the/usr/binliteral. Bump wrapper version5 → 6so existing installs regenerate against the resolved path.No docs changed:
__fish_real_commandis an internal__-helper (not catalogued in the SSOT, consistent with__fish_config_op_enabled), and the SSOT wrapper prose never asserted a/usr/binpath.Manual Verification
fish-deps(status) shows paru and yay with their real paths (e.g./usr/bin/paru), not~/.local/bin/paru.head -20 ~/.local/bin/paru— the wrapper regenerated at# paru-wrapper-version: 6and itscmd_str="…"points at the real binary (not~/.local/bin/paru). Same for yay.paru -Qi <pkg>(or any paru/yay invocation) still runs correctly through the wrapper with progress preserved, and a fresh log lands in~/.terminal_history.__fish_real_command rgreturns the realrgbinary (function-shadowed command still resolves correctly).__fish_real_command __nonexistent;echo $status→ prints nothing, status1.set -U __fish_config_op_logging 0, new shell), the~/.local/bin/{paru,yay}shims are removed andfish-depsstill shows the real paths; re-enable afterward.The generated PTY-logging wrappers hardcoded /usr/bin/{paru,yay} both for the presence check and as the command the wrapper shells out to, breaking on any host where the binary lives elsewhere. Resolve the real path via __fish_real_command (which skips our own shim) and embed that. Bump the wrapper version 5 -> 6 so existing installs regenerate.