Why: On Fish 4.x, the first help config … (e.g. help config --html) prints an error before running:
source: Error encountered while sourcing file '/usr/share/fish/functions/help.fish':
source: No such file or directory
functions: Function 'help' does not exist
Fish 4.x moved the native help function into the binary (embedded:functions/help.fish) — there is no longer an on-disk $__fish_data_dir/functions/help.fish to source. functions/help.fish tried to source that path to back up native help before shadowing it; the source failed, and functions -c help __original_help then ran with no help yet defined. Subsequent calls "worked" only because the file wasn't re-sourced — but __original_help was never captured, silently breaking the native fallback for non-config topics too.
Root cause: the backup can't live in functions/help.fish at all. An autoload shadow of that name makes help resolve to our own wrapper (or nothing, mid-autoload), so functions -c help can never capture the embedded original.
What:
Move the wrapper to conf.d/help.fish, sourced at startup before any shadow exists. There functions -c help __original_help copies the embedded native help correctly.
Delete the obsolete functions/help.fish.
Behavior is otherwise identical: help config … → config-help; all other topics → __original_help; the C1 opinionated guard (__fish_config_op_aliases) still applies at runtime.
No dependency on PR #67 — different files, independent root cause.
Manual Verification
Open a brand-new shell and run help config --html — it opens the HTML docs with nosource:/Function 'help' does not exist error.
help config --help prints the config-help usage reference (exit 0).
help config keys opens the terminal manual at the Key Bindings section.
help string (a non-config topic) still opens fish's native docs for string.
functions -q __original_help; and echo backed-up prints backed-up in a fresh shell.
With set -g __fish_config_op_aliases 0, help config falls through to native fish help instead of config-help.
## Summary
**Why:** On Fish 4.x, the first `help config …` (e.g. `help config --html`) prints an error before running:
```
source: Error encountered while sourcing file '/usr/share/fish/functions/help.fish':
source: No such file or directory
functions: Function 'help' does not exist
```
Fish 4.x moved the native `help` function into the binary (`embedded:functions/help.fish`) — there is no longer an on-disk `$__fish_data_dir/functions/help.fish` to `source`. `functions/help.fish` tried to source that path to back up native help before shadowing it; the source failed, and `functions -c help __original_help` then ran with no `help` yet defined. Subsequent calls "worked" only because the file wasn't re-sourced — but `__original_help` was never captured, silently breaking the native fallback for non-config topics too.
**Root cause:** the backup can't live in `functions/help.fish` at all. An autoload shadow of that name makes `help` resolve to our own wrapper (or nothing, mid-autoload), so `functions -c help` can never capture the embedded original.
**What:**
- Move the wrapper to **`conf.d/help.fish`**, sourced at startup *before* any shadow exists. There `functions -c help __original_help` copies the embedded native help correctly.
- Delete the obsolete **`functions/help.fish`**.
- Behavior is otherwise identical: `help config …` → `config-help`; all other topics → `__original_help`; the C1 opinionated guard (`__fish_config_op_aliases`) still applies at runtime.
No dependency on PR #67 — different files, independent root cause.
## Manual Verification
- [x] Open a **brand-new** shell and run `help config --html` — it opens the HTML docs with **no** `source:`/`Function 'help' does not exist` error.
- [x] `help config --help` prints the config-help usage reference (exit 0).
- [x] `help config keys` opens the terminal manual at the Key Bindings section.
- [x] `help string` (a non-config topic) still opens fish's native docs for `string`.
- [x] `functions -q __original_help; and echo backed-up` prints `backed-up` in a fresh shell.
- [x] With `set -g __fish_config_op_aliases 0`, `help config` falls through to native fish help instead of `config-help`.
Fish 4.x ships the native `help` function embedded in the binary
(embedded:functions/help.fish) with no on-disk file. The old
functions/help.fish tried to `source $__fish_data_dir/functions/help.fish`
to back up the native help before shadowing it — that path no longer exists,
so the first `help config ...` call errored:
source: No such file or directory
functions: Function 'help' does not exist
The backup cannot happen from functions/help.fish at all: an autoload shadow
of that name makes `help` resolve to our own wrapper (or nothing, mid-load),
so `functions -c help` can never capture the embedded original.
Move the wrapper to conf.d/help.fish, sourced at startup before any shadow
exists, where `functions -c help __original_help` copies the embedded native
help. Behavior is otherwise unchanged: 'help config' delegates to config-help,
all other topics fall through to __original_help, and the C1 opinionated guard
still applies. Delete the obsolete functions/help.fish.
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
Why: On Fish 4.x, the first
help config …(e.g.help config --html) prints an error before running:Fish 4.x moved the native
helpfunction into the binary (embedded:functions/help.fish) — there is no longer an on-disk$__fish_data_dir/functions/help.fishtosource.functions/help.fishtried to source that path to back up native help before shadowing it; the source failed, andfunctions -c help __original_helpthen ran with nohelpyet defined. Subsequent calls "worked" only because the file wasn't re-sourced — but__original_helpwas never captured, silently breaking the native fallback for non-config topics too.Root cause: the backup can't live in
functions/help.fishat all. An autoload shadow of that name makeshelpresolve to our own wrapper (or nothing, mid-autoload), sofunctions -c helpcan never capture the embedded original.What:
conf.d/help.fish, sourced at startup before any shadow exists. Therefunctions -c help __original_helpcopies the embedded native help correctly.functions/help.fish.help config …→config-help; all other topics →__original_help; the C1 opinionated guard (__fish_config_op_aliases) still applies at runtime.No dependency on PR #67 — different files, independent root cause.
Manual Verification
help config --html— it opens the HTML docs with nosource:/Function 'help' does not existerror.help config --helpprints the config-help usage reference (exit 0).help config keysopens the terminal manual at the Key Bindings section.help string(a non-config topic) still opens fish's native docs forstring.functions -q __original_help; and echo backed-upprintsbacked-upin a fresh shell.set -g __fish_config_op_aliases 0,help configfalls through to native fish help instead ofconfig-help.Fish 4.x ships the native `help` function embedded in the binary (embedded:functions/help.fish) with no on-disk file. The old functions/help.fish tried to `source $__fish_data_dir/functions/help.fish` to back up the native help before shadowing it — that path no longer exists, so the first `help config ...` call errored: source: No such file or directory functions: Function 'help' does not exist The backup cannot happen from functions/help.fish at all: an autoload shadow of that name makes `help` resolve to our own wrapper (or nothing, mid-load), so `functions -c help` can never capture the embedded original. Move the wrapper to conf.d/help.fish, sourced at startup before any shadow exists, where `functions -c help __original_help` copies the embedded native help. Behavior is otherwise unchanged: 'help config' delegates to config-help, all other topics fall through to __original_help, and the C1 opinionated guard still applies. Delete the obsolete functions/help.fish.