From 1e18b12d4616d541a45653c98351d991ca849498 Mon Sep 17 00:00:00 2001 From: Sediman Date: Tue, 26 May 2026 23:40:23 +0200 Subject: [PATCH] fix(alias-finder): replace '{0,1} with '? for BSD grep compatibility BSD grep on macOS does not handle the '{0,1} ERE quantifier correctly, causing 'grep: invalid repetition count(s)' errors on every command when autoload is enabled. Replace with the equivalent POSIX '? pattern which works on both BSD and GNU grep. Fixes #13416 --- plugins/alias-finder/alias-finder.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 6f24c7089..de5fcf673 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -1,5 +1,5 @@ alias-finder() { - local cmd=" " exact="" longer="" cheaper="" wordEnd="'{0,1}$" finder="" filter="" + local cmd=" " exact="" longer="" cheaper="" wordEnd="'?$" finder="" filter="" # build command and options for c in "$@"; do @@ -31,7 +31,7 @@ alias-finder() { # find with alias and grep, removing last word each time until no more words while [[ $cmd != "" ]]; do - finder="'{0,1}$cmd$wordEnd" + finder="'?$cmd$wordEnd" # make filter to find only shorter results than current cmd if [[ $cheaper == true ]]; then