You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(light): classic zi light loads with full tracking, like zi load #586
Zi next at 3fa8433 (GitHub tarball), Zsh 5.9.2, Linux x86_64, zsh -f.
Minimal reproduction
A local plugin directory demo holding demo.plugin.zsh:
demo_fn() { :; }
bindkey "^X^D" demo_fn
Load it once in each of three fresh zsh -f shells, each sourcing zi.zsh, then print the plugin's state records from ZI:
zi light /path/to/demo # shell 1
zi light-mode for /path/to/demo # shell 2
zi load /path/to/demo # shell 3forkin${(k)ZI};do
[[ $k== (STATES__*|FUNCTIONS_BEFORE__*|BINDKEYS__*) ]] && print -r -- "$k=${ZI[$k][1,40]}"done
Actual behavior
Command
STATES__%.../demo
FUNCTIONS_BEFORE__
BINDKEYS__
zi light /path/to/demo
2
recorded
^X^D demo_fn recorded
zi light-mode for /path/to/demo
1
empty
empty
zi load /path/to/demo
2
recorded
^X^D demo_fn recorded
Classic zi light loads the plugin with full tracking, exactly like zi load. The classic-syntax branch in zi.zsh sets ICE[light-mode]= (line 3030 on next) and then runs ICE=() ZI_ICE=() (line 3035) after copying ICE into ZI_ICES, so the light flag does not reach the load.
Expected behavior
zi light loads without tracking, as README.md:75 ("light loads a plugin without tracking and reporting overhead") and docs/man/zi.1:562 ("Light plugin load, without reporting/tracking") say: the same records as zi light-mode for (STATES__1, no function or bindkey records). zi light -b should keep tracking bindkey calls only.
Found while reviewing the unload work for #113 and #582; it is not part of those issues.
Status Todo: reproduced on next at 3fa8433 (table above), and the documented behaviour (README.md:75, docs/man/zi.1:562) defines the fix.
Item Type Bug, Impact Medium: every classic zi light user pays the tracking cost the command exists to avoid, and unload records differ from light-mode for.
Effort S: carry the light flag through the classic-syntax branch (zi.zsh lines 3030-3035) plus a test comparing the three load forms.
Corrected cause: the light flag is not lost at zi.zsh lines 3030-3035. ICE[light-mode] is restored from the saved ices before the load. The classic branch sets ___is_snippet=-1 (line 3031), and the dispatch at line 3207 tests (( ___is_snippet )), which is true for -1, so a classic zi load or zi light plugin takes the snippet branch: the mode passed to .zi-load is the option keys, never light or light-b. Every other test of that variable uses > 0 or >= 0 (lines 3089, 3102, 3154, 3172, 3228).
Next action: add tests/light-tracking.zsh covering zi light, zi light -b, zi light-mode for and zi load, which reproduces the table above, then change line 3207 so a classic plugin takes the plugin branch, with -b honoured for light only so zi load keeps full tracking.
Activity
ss-o commentedon Oct 2, 2026
Project 28 triage. Values set on this new issue:
Todo: reproduced onnextat3fa8433(table above), and the documented behaviour (README.md:75,docs/man/zi.1:562) defines the fix.Bug, ImpactMedium: every classiczi lightuser pays the tracking cost the command exists to avoid, and unload records differ fromlight-mode for.S: carry the light flag through the classic-syntax branch (zi.zshlines 3030-3035) plus a test comparing the three load forms.P2 - Medium, WorkstreamHuman delivery: the same values as the sibling unload issues fix(unload): repeated-load takeover misses linked keymaps and duplicates keymap records #583 and refactor(unload): chain-aware restore for per-load ownership records #585.ss-o commentedon Oct 7, 2026
Work started on
nextat 2fdcae7.Corrected cause: the light flag is not lost at
zi.zshlines 3030-3035.ICE[light-mode]is restored from the saved ices before the load. The classic branch sets___is_snippet=-1(line 3031), and the dispatch at line 3207 tests(( ___is_snippet )), which is true for -1, so a classiczi loadorzi lightplugin takes the snippet branch: the mode passed to.zi-loadis the option keys, neverlightorlight-b. Every other test of that variable uses> 0or>= 0(lines 3089, 3102, 3154, 3172, 3228).Next action: add
tests/light-tracking.zshcoveringzi light,zi light -b,zi light-mode forandzi load, which reproduces the table above, then change line 3207 so a classic plugin takes the plugin branch, with-bhonoured forlightonly sozi loadkeeps full tracking.fix(light): keep -b over a light-mode ice and isolate the test
test(light): cover pending ices and bindmap with a plain light load
fix(light): skip the PATH snapshot for light -b
github-actions commentedon Oct 8, 2026
Released to
mainby promotion #617; the fix merged intonextin #594.