feat(templates): add allow-telemetry wrapper template #182
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#182
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
Adds a new
templates/directory. It holds starting points for users' own functions. The first template isallow-telemetry.fish. It wraps one command and removes a list of environment variables from that command's process only. Every other tool still sees them.Settings are two file-scope lines at the top:
function $wrap_cmd -V wrap_cmd -V wrap_unsetfreezes both values into the function, so they do not leak into the shell.env -u …runs the external binary, so the wrapper cannot recurse. To use it, a user edits the two lines and saves the file as<cmd>.fish.Changes
templates/allow-telemetry.fish: the template.tests/run-tests.fish: the syntax/indent lint now coverstemplates/.tests/test-templates.fish: instantiates the template against a stub binary. It checks that the listed vars are removed, other vars are kept, arguments and exit status pass through, the parent keeps the vars, the settings do not leak, and an empty list is a no-op..github/workflows/ci.yml:templates/**added to the push paths and the PR relevance regex.README.md: new "Function templates" subsection under Personalization.Verification
fish tests/run-tests.fish: 257/257 lint, 923/923 assertions, exit 0.Follow-up (not in this PR)
More templates, and a generator that reads the
set -lsettings block and writes literal values, so__fish_help_headercan findfunction <name>. Output goes to user-dotsfunctions/when present. That directory is not on$fish_function_pathtoday.https://claude.ai/code/session_015eE4sQqrZ8yKGkTMf58shs