Does ohmyzsh automatically invalidate its completion cache when a new executable is added to $PATH?
28K reputation · 02 Jun 2021, 05:19 UTC
Ohmyzsh stores generated completions in a cache directory to speed up shell startup. The cache is considered valid based on the modification times of the source completion scripts, but it does not automatically track newly added executables in the user's $PATH.
When a new command‑line tool that ships its own completion script is installed, users often observe that tab completion does not appear until the cache is manually cleared. This raises the question of whether ohmyzsh should provide an automatic invalidation hook for PATH changes, and what the current behavior actually is.
Does ohmyzsh automatically invalidate its completion cache when a new executable is added to $PATH? What mechanism, if any, does ohmyzsh currently use to detect changes in $PATH for cache invalidation?