Is that possible to let terminal update autocomplete for new executable files in path automatically? I am running MacOS Big Sur 11.2.3 (20D91) and using zsh (the default shell).
Whenever I added new executable files/scripts to $PATH, I can not auto-complete the script filename in the existing terminals. I have to open a new terminal to make the autocomplete work for the new files.
Is that possible to make the autocomplete work for new files in $PATH automatically for old existing terminal sessions?
Thanks a lot.
The issue is that the new command is not been entered into the hash table that zsh that maps commands to the full name.
The command hash table is built when you first attempt a command in a new shell as you have shown.
To make the command get added to the table without startinga new shell run the command rehash