On MacOS I am using oh-my-zsh with no customization that I know of.
Autocompletion is mostly working quite nicely and I'm very happy with it. But for some reason the diff
command is different.
➜ ls file<TAB>
file1 file2
➜ diff file1 file<TAB> # Rings bell and no completion
➜ diff file1 <TAB> # Gives me a "-" completion
➜ diff file1 -<TAB>
-b -- skip trailing white spaces
-c -- output a context diff
-e -- output an ed script
-f -- output a reversed ed script
-r -- recursively compare subdirectories
So diff
seems unaware that you can provide a second argument as the second file to diff, and it only seems to only accept command options as the second thing.
Any ideas what is happening or how to fix this?
In general, is there an easy way to configure to fully disable the smart completion for a particular command? I did compdef _files diff
and that worked in that shell but not in subsequent new shells.
type diff
say? Andecho $_comps[diff]
? What version of macOS? If you can't resolve this, use^X?
instead of TAB to complete and upload the trace output file.type diff
shows diff aliased todiff --color
. I didn't even realize this and must have made this alias eons ago. Removing that alias fixed the issue and lesson learned on diagnosing these kinds of issues. Thanks again. The git support in oh-my-zsh is incredible and changed my life (for the better).diff
defined as an alias. For me, the behavior is that the completion works fine only if I do not specify the-u
argument. When I do, the second parameter todiff
is not auto-completed.