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
This commit is contained in:
@@ -112,7 +112,10 @@ zstyle ':omz:plugins:eza' 'icons' yes
|
|||||||
zstyle ':omz:plugins:eza' 'color-scale' all
|
zstyle ':omz:plugins:eza' 'color-scale' all
|
||||||
zstyle ':omz:plugins:eza' 'color-scale-mode' fixed
|
zstyle ':omz:plugins:eza' 'color-scale-mode' fixed
|
||||||
zstyle ':omz:plugins:eza' 'size-prefix' si
|
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:*' menu select
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
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
|
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 c='clear'
|
||||||
alias q="exit"
|
alias q="exit"
|
||||||
alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\''
|
alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\''
|
||||||
|
|||||||
Reference in New Issue
Block a user