I am unable to update a function definition in my zsh dotfiles.
Specifically, I have this in my ~/.zshrc
unalias cd 2>/dev/null # Prevent infinite loops if sourcing this file again in the same session
logged_cd() {
cd "$@"
pwd > ~/.last_cd
}
alias "cd"="logged_cd" # keep track of most recent directory
I want to update the logged_cd function
logged_cd() {
cd "$@" && pwd > ~/.last_cd || return 1
}
So I updated my ~/.zshrc
with the updated code, and did source ~/.zshrc
but the old definition was still there.
I saw this one related question that suggested using unfunction
which I tried, but that didn't work either.
Note that I also tried opening a new tab in my terminal so that zsh would be reloaded entirely but even in the new shell, it still is using the old function definition. Is something else going on here?