From 7e64b1261d51d6155aa3ab4539b27ce5454b5c49 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sun, 19 Jan 2025 13:42:37 +0000 Subject: [PATCH] Fix issue with adding eza command on new session --- zshrc.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zshrc.zsh b/zshrc.zsh index b50caf7..2b2ad9e 100644 --- a/zshrc.zsh +++ b/zshrc.zsh @@ -36,8 +36,10 @@ ezacd () { eza --oneline --long --classify --icons --header } +# Initialize chpwd_functions if it doesn't exist +typeset -ga chpwd_functions # Only add ezacd to chpwd_functions if it's not already there -if (( ${chpwd_functions[(I)ezacd]} == 0 )); then +if [[ ${chpwd_functions[(ie)ezacd]} -gt ${#chpwd_functions} ]]; then chpwd_functions=(${chpwd_functions[@]} "ezacd") fi