Skip to content

Conversation

@bxsx
Copy link
Contributor

@bxsx bxsx commented Jan 22, 2026

Summary

Fixes #555 - a regression where FZF_TAB_MODULE_VERSION is lost when re-sourcing fzf-tab.zsh.

The problem: #555 unconditionally unsets FZF_TAB_MODULE_VERSION on every source. However, zmodload doesn't reload an already-loaded module, so the boot callback that sets this variable never runs again. Result: the variable is permanently lost after re-sourcing.

The fix: Only unset the variable when the module is not loaded. If it's already loaded, the existing value is valid and should be preserved.

Why this approach and a duplicate of PR #556?

The PR #556 proposes a different approach in resolving the same issue by unloading the module (zmodload -u) before reloading. While that also solves the problem, this PR's approach is better because:

Aspect This PR #556
Operation Conditional unset only Full module unload + reload
Performance Minimal overhead Higher cost
Side effects None Resets any module state
Complexity Simple check More invasive

The conservative approach here preserves existing behavior and only changes what's strictly necessary to fix the bug.

Previously, FZF_TAB_MODULE_VERSION was always unset on source.
This caused the variable to be lost when re-sourcing fzf-tab.zsh,
because zmodload won't reload an already-loaded module.

Now the variable is only unset if the module is not loaded.
@alberti42
Copy link
Contributor

Hi @bxsx,

Did you check my other PR #556? Unfortunately, I realized too late that there was something missing in my initial PR, which was merged upstream. I filed a second a PR to correct the bug.

Is #556 fixing the same problem as your PR?

@bxsx
Copy link
Contributor Author

bxsx commented Jan 29, 2026

Is #556 fixing the same problem as your PR?

Hi! Yes, both PRs fix the same issue but with different approach. I put the comparison between them in the description

@Aloxaf
Copy link
Owner

Aloxaf commented Feb 3, 2026

LGTM

@Aloxaf Aloxaf merged commit f9d0fcd into Aloxaf:master Feb 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants