Fix issue with adding eza command on new session

This commit is contained in:
Jonny Barnes 2025-01-19 13:42:37 +00:00
parent 3bd7aac84f
commit 7e64b1261d
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8

View file

@ -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