Skip to content

zfresh - Fresh Full Bundle Recompilation

Performs a complete clean rebuild of the full bundle system and restarts the shell. Ideal after major configuration changes when you want a guaranteed fresh state.

Overview

zfresh deletes the existing full bundle cache and compiled zshrc bytecode, recompiles everything from scratch via zfull or zprime --full, and optionally restarts the shell. This is the nuclear option — use it when zr alone isn't enough or when you suspect cache corruption.

When to use: After major config overhauls, when startup behaves unexpectedly, or when you want to guarantee a completely clean compilation.

Usage

zfresh [options]

Options

  • -n, --no-exec: Recompile but do not restart the shell
  • -h, --help: Show help message

Examples

# Complete rebuild and automatic shell restart
zfresh

# Rebuild without restarting (useful in scripts)
zfresh --no-exec

What It Does

  1. Validates paths — checks ZSHAND and ZSHAND_CACHE_DIR are safe before deletion
  2. Deletes old cache — removes zshand-full.zsh, zshand-full.zwc, and zshrc.zwc
  3. Recompiles — calls zfull (or zprime --full as fallback) to build a fresh bundle
  4. Restarts shell — runs exec zsh to load the new bundle (unless --no-exec)

If compilation fails, the shell is not restarted to avoid a broken session.

Dependencies

  • Required: zfull or zprime --full (framework build system)
  • Required: ZSHAND framework directory

See Also

  • zfull — Full bundle compilation (framework + user)
  • zr — Standard incremental rebuild
  • zrebuild — Force rebuild with syntax validation