From c4a804e760215ccdd85f2622353914d59279df15 Mon Sep 17 00:00:00 2001 From: Jeremy McClure Date: Wed, 29 Jul 2026 11:09:12 -0400 Subject: [PATCH] zsh: fix eza --hyperlink eating path argument (e.g. 'la /') The oh-my-zsh eza plugin adds a bare --hyperlink flag as the last tail option. eza's --hyperlink takes an optional value, so clap swallows the next token (the path) -> 'la /' fails with 'invalid value /'. - Drop the 'hyperlink' zstyle so the plugin stops adding the bare flag - After oh-my-zsh loads, append the glued --hyperlink=always form to each eza alias; the glued form cannot eat the next token, so paths work and hyperlinks stay on --- zsh/zshrc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zsh/zshrc b/zsh/zshrc index b80b1cb..fa0f223 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -112,7 +112,10 @@ zstyle ':omz:plugins:eza' 'icons' yes zstyle ':omz:plugins:eza' 'color-scale' all zstyle ':omz:plugins:eza' 'color-scale-mode' fixed zstyle ':omz:plugins:eza' 'size-prefix' si -zstyle ':omz:plugins:eza' 'hyperlink' yes +# NOTE: 'hyperlink' is intentionally NOT set here. The oh-my-zsh eza plugin adds +# a bare "--hyperlink" flag which eza (clap) treats as taking the next token as +# its optional value, so `la /` fails with "invalid value '/'". We re-enable +# hyperlinks safely below via the glued `--hyperlink=always` form. zstyle ':completion:*' menu select zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' @@ -121,6 +124,14 @@ zstyle ':completion:*' special-dirs true source $OHMYZSH/oh-my-zsh.sh +# Re-enable eza hyperlinks safely. The oh-my-zsh eza plugin's bare +# --hyperlink flag eats the following path argument (eza clap optional-value), +# so we append the glued --hyperlink=always form to each eza alias instead. +for _ea in la ldot lD lDD ll ls lsd lsdl lS lT; do + (( $+aliases[$_ea] )) && alias "$_ea"="${aliases[$_ea]} --hyperlink=always" +done +unset _ea + alias c='clear' alias q="exit" alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\''