Automatic cd: Zsh simplifies directory navigation by enabling users to change directories simply by typing the name of the desired directory. This feature eliminates the need to type the “cd” command explicitly, saving time and keystrokes.
What if there happens to be a command with the same name?
it does but if you had a file called reboot tab complete would complete the reboot command and not put the slash thwre, adding the slash specifies that it’s a directory
What if there happens to be a command with the same name?
command goes first
order is shell built in > path > autocd
Then you’re likely to enter a command by accident. I would consider that a dangerous misfeature and look to turn it off.
not really tab complete puts a / at the end of autocd directories
Can you not type in the name of the hazardous folder yourself? I’m envisioning trying to autocd into a folder named
reboot
or something.then you would type
reboot/
Does autocd not work without a slash at the end?
it does but if you had a file called reboot tab complete would complete the reboot command and not put the slash thwre, adding the slash specifies that it’s a directory
I’ve got syntax highlighting enabked, so I always notice the different color when I type a commnand.
Don’t name your directories “rm” or “fdisk” problems solved
Until I forget about some command or another, and accidentally give a folder the same name.
Don’t name your directories “rm” or “fdisk” problems solved