Compare commits

...
Author SHA1 Message Date
Robby RussellandMonson Shao 934576b89b feat(init): keep the zcompdump file in $ZSH_CACHE_DIR
The default dump file moves from `${ZDOTDIR:-$HOME}` to `$ZSH_CACHE_DIR`,
so it no longer clutters the home directory. `ZSH_COMPDUMP` still
overrides the location, and `omz reload` already deletes the dump
wherever it lives. Diagnostics list dump files in both places.

The first shell after updating rebuilds the dump once. Old
`~/.zcompdump-*` files are left in place and can be deleted.

Closes #13406

Co-Authored-By: Monson Shao <holymonson@gmail.com>
2026-11-24 15:54:27 -08:00
2 changed files with 5 additions and 4 deletions

No files matched your search

+4 -3
View File
@@ -237,9 +237,10 @@ function _omz_diag_dump_one_big_text() {
fi
builtin echo
builtin echo "Zsh compdump files:"
local dumpfile dumpfiles
command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) )
local dumpfile
local -U dumpfiles
dumpfiles=( $zdotdir/.zcompdump*(N) ${ZSH_COMPDUMP:h}/.zcompdump*(N) )
(( $#dumpfiles )) && command ls -lad $dumpfiles
if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile
+1 -1
View File
@@ -128,7 +128,7 @@ fi
# Save the location of the current completion dump file.
if [[ -z "$ZSH_COMPDUMP" ]]; then
ZSH_COMPDUMP="${ZDOTDIR:-$HOME}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
ZSH_COMPDUMP="${ZSH_CACHE_DIR}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
# Resolve the commit $ZSH is checked out at into $REPLY by reading the git