Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> > Jannis Harder told me that the zsh completion for mkdir would run mkdir --help (to see if it’s the GNU variant), which I could verify.

> Completions are typically installed as an add-on or as part of a core library of a shell.

Right, but the completions were doing the correct thing for `mkdir`. The problem is that in their dotfiles they told it to use the `mkdir` completions for a command that isn't `mkdir`; and what is correct for `mkdir` isn't correct for that other command.

This fix was to make this edit to their own dotfiles:

    -compdef mkcd=mkdir
    +_mkcd() { _path_files -/ }
    +compdef _mkcd mkcd


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: