From 080c66d460f09e9b705d3b38be14fbff15c96b78 Mon Sep 17 00:00:00 2001 From: Ininsico Date: Fri, 29 May 2026 12:07:12 +0500 Subject: [PATCH 1/2] fix(brew): add HOMEBREW_PREFIX/sbin to PATH to suppress brew doctor warning Some Homebrew formulae (e.g. mtr) install executables to the sbin directory. Homebrew's shellenv only adds bin directories, causing brew doctor to emit a warning when sbin is missing from PATH. Add /sbin to PATH if the directory exists. --- plugins/brew/README.md | 6 ++++++ plugins/brew/brew.plugin.zsh | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index 07c387380..5e3e3fab6 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -17,6 +17,12 @@ If `brew` is not found in the PATH, this plugin will attempt to find it in commo In case you installed `brew` in a non-common location, you can still set `BREW_LOCATION` variable pointing to the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environment. +### sbin directory + +This plugin also adds `$HOMEBREW_PREFIX/sbin` to the PATH if the directory exists and isn't already present. +Some Homebrew formulae (e.g. `mtr`) install executables to `sbin`, which `brew doctor` checks for. This +ensures the `bdr` alias runs without warnings. + ## Aliases | Alias | Command | Description | diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 7d5db2068..45cd89f44 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -30,6 +30,16 @@ if [[ -z "$HOMEBREW_PREFIX" ]]; then export HOMEBREW_PREFIX="$(brew --prefix)" fi +# Add Homebrew sbin to PATH if it exists and is not already in PATH. +# Homebrew's shellenv only adds bin directories, not sbin. Some formulae +# (e.g. mtr) install executables to sbin, and brew doctor warns if it's +# missing from PATH. +if [[ -d "$HOMEBREW_PREFIX/sbin" ]]; then + if [[ ! "$PATH" == *"$HOMEBREW_PREFIX/sbin"* ]]; then + export PATH="$HOMEBREW_PREFIX/sbin:$PATH" + fi +fi + if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions") fi From 691fdc7c46673aa58e3f925e64c98630779cb3cd Mon Sep 17 00:00:00 2001 From: Ininsico Date: Fri, 29 May 2026 12:16:58 +0500 Subject: [PATCH 2/2] fix(colorize): pass ZSH_COLORIZE_CHROMA_FORMATTER to cless function The cless function did not forward the ZSH_COLORIZE_CHROMA_FORMATTER environment variable to the colorize_cat preprocessor, causing colors to render incorrectly on 256-color terminals when using chroma as the syntax highlighter. ccat worked correctly because it passed the variable directly. Fixes #12650 --- plugins/colorize/colorize.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index c49acd864..68b620b82 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -90,6 +90,7 @@ colorize_less() { # (e.g. when not scrolled to the bottom) while already the next file will be displayed. local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \ ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \ + ZSH_COLORIZE_CHROMA_FORMATTER=$ZSH_COLORIZE_CHROMA_FORMATTER \ colorize_cat %s 2> /dev/null'" # LESSCLOSE will be set to prevent any errors by executing a user script