Skip to main content

Environment Variables

Manage Windows registry and macOS shell environment variables, inspect process snapshots, preview invalid PATH cleanup, and keep restorable backups.

Free & Open Source Developer env environment path variables
Version 1.0.9 Updated 2026-11-25
Download ZTools to Install Install ZTools, then search for "Environment Variables" in the Plugin Marketplace

Screenshots

Environment Variables - Preview 1

Key Features

Inspect process variables and manage Windows or macOS persistent environment variables

env / path / environment variables / env manager

Preview and clean nonexistent directories from persistent PATH entries

clean path / fix path / invalid path / cleanup env

View or restore pre-edit backups and copy current variable snapshots

backup env / export env / restore env

Overview & Usage Guide

Inspect a snapshot of the current process's environment variables, manage Windows user/system variables or macOS shell variables, preview cleanup of nonexistent PATH directories, and keep restorable backups before making changes.

Usage

  • Commands: Environment Variables (keywords such as env, path, environment variables, env manager), plus dedicated commands to preview and clean nonexistent PATH directories from persistent configuration (clean path, fix path) and to view/restore pre-edit backups or copy the current variable snapshot (backup env, export env, restore env).
  • Views: Switch views on the right side of the search bar: All Variables, User Config (Shell Config on macOS), System Config (Windows only), Current Process (read-only), PATH Entries, PATH with Invalid Entries, and Edit Backups.
  • Shortcuts:
    • Persistent config variables: Enter to edit, ⌘/Ctrl+Enter to copy value, ⌘/Ctrl+K to remove a variable or preview PATH cleanup.
    • Current process variables: Enter to copy value, ⌘/Ctrl+Enter to write to persistent config.
    • Edit backups: Enter to preview and restore the previous configuration.
  • Safe Modification Flow: Creating, editing, removing, cleaning, or restoring variables first displays a summary of changes and target locations (listing directories to remove during cleanup). After confirmation, the plugin saves and verifies a backup of the original configuration, writes the changes, reads back to verify, and only then reports success.
  • macOS: Supports zsh and Bash. For zsh, writes to $ZDOTDIR/.zshrc (or ~/.zshrc if unset); for Bash, writes to ~/.bash_profile. Only the ZTools-managed block in the file is modified, leaving all other content untouched. Variable values are stored literally—$HOME, backticks, and command expressions are not evaluated. Changes take effect in newly opened terminals that source the file, though other startup scripts may still affect final values. The variable list and PATH cleanup only cover this managed block; variables set elsewhere in scripts are not listed. Saving PATH in shell config replaces the PATH for new terminals (entries set earlier by .zprofile, Homebrew, etc. will no longer apply), so PATH must be a complete list of directories starting with /, must retain /usr/bin and /bin, and is rejected if it contains $, backticks, or ~. Because the current process PATH is the minimal GUI app environment, "Write to Persistent Config" is disabled for PATH on macOS. For Bash, if ~/.bash_profile does not exist while ~/.bash_login or ~/.profile exists, the plugin stops instead of creating a file that would shadow them. Original files are backed up to a .ztools-env-recovery-* folder in the same directory, and the path is shown upon success.
  • Windows: Reads raw values from the current user and system registry keys. Modifying system variables requires appropriate privileges. Applications launched after signing out and back in will inherit the updated environment.
  • Read-Only Process Snapshot: The current process snapshot is read-only; modifying persistent configuration does not alter already running applications.
  • PATH Cleanup Rules: Only removes local absolute directories confirmed not to exist. Empty entries, relative paths, unverifiable paths, external volumes, and entries containing variable references are preserved in their original order. Cleanup aborts if the resulting PATH would be empty.
  • Backup Restore Guard: Restoring a backup aborts if the configuration has been modified since that backup was created so newer edits are not overwritten; the backup remains intact.
  • Security Note: "Copy Variable Snapshot" copies the actual values currently read, which may contain secrets or tokens—store the copied output securely.

Platforms & Requirements

  • Supported: Windows, macOS
  • Requires client version 1.1.8.5 or later.
  • Windows implementation is pending physical-device verification.

Network & Data

  • Offline only; backups and modifications stay on your device.

Frequently Asked Questions (FAQ)

How do I install and launch "Environment Variables" in ZTools?

Open the Plugin Marketplace inside ZTools Workbench, search for "Environment Variables", and install it. Then type its name in the launcher bar to open it.

Is "Environment Variables" free? Which platforms are supported?

Yes, it is free to install with source code published in the ZTools-extensions repository. Supported platforms: Windows / macOS.