fix: guard and document the external tools PR #168 flagged as unguarded #170
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#170
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
PR #168's Notes section named several functions with a real external-tool dependency that no
type -q/command -q/command -v/whichguard covers anywhere in the tree, deliberately left out ofDEPENDENCIESto avoid breakingtest_dependencies_resolve. This adds the missing guard to each, then declares the dependency now that it resolves.bkg,detachnohupgituigitui(self-shadow — guarded withtype -q -fto skip the function itself)play-mediampv,vlc— see the bug below, this one was already guardedsteam-dlsystemd-inhibit,steamwake-locksystemd-inhibitsplit,spwin,tabwezterm,konsole(kittywas already declared)A real bug in the checker, not just missing guards
play-media.fishalready guards itsmpv/vlcfallback withtype -q -f $pinsidefor p in mpv vlc— it just wasn't recognized as a guard.docs/verify-manual.py's guard-detection regex only matchedtype -q <name>with the name immediately following-q, so the-fflag (which excludes functions from the match — needed anywhere a wrapper shadows a binary of its own name, e.g.gitui) broke both the direct match and the loop-variable indirection. That's why the previous PR's own tooling reported it as unguarded when it wasn't. Broadened both patterns intest_dependencies_resolveto skip over any flags between-qand the name/variable.A related latent bug:
$TERMchecks don't prove the binary existssplit/spwin/tabdispatch on$TERM/$TERM_PROGRAM/$KONSOLE_VERSIONto pick which terminal-specific binary to call, per this repo's C4 convention — but those env vars only prove the terminal type, not that its CLI binary is on$PATH. They propagate overssh, so sshing out from Kitty/WezTerm inherits the var on a remote host that never installed the binary, and the function would previously hand that straight tokitty @ launch/wezterm cli .../konsolewith no existence check, surfacing a raw "command not found" instead of a clean error.clone/clonethave the identical gap:clone-in-kittyis a function Kitty's own shell integration injects into the local shell, not present on a remote shell that only inherited$TERM=xterm-kitty. All five functions now check the actual thing they're about to call, in addition to the$TERM-based dispatch that picks which one to check.Found by the same audit, same pattern, not in PR #168's list
fast-cli(fast),lock(loginctl),ports(lsof),screensleep(busctl) had the identical shape — a real external-tool dependency, called with no existence guard and noDEPENDENCIESentry. Fixed alongside the named ones since it's the same oversight, not a separate task.Deliberately left alone
spark(awk),sudo-toggle(sudo/stat/truncate/tee) call only baseline POSIX/coreutils tools already assumed present everywhere else in the tree unguarded — adding guards there would be inconsistent with how the rest of the manual treats those tools.swapstat'szramctl/swaponalready degrade gracefully via an output-emptiness check rather than an existence check; that's a different, already-adequate pattern, not an oversight.Verification
python3 docs/build-manual.py --concat -o docs/fish-config.md— regenerated.python3 docs/verify-manual.py— 84/84 passed,test_dependencies_resolveincluded (now resolves every new entry above).fish tests/run-tests.fish— 757/757 assertions passed, exit 0, syntax/indent lint 253/253, shadow-classification lint 196/196.fish_indentbyte-check on every changed.fishfile — clean.