First, let's assume that I have:
alias foo='path/to/my/program'
in my .zshrc
, then I created a completion script ~/.oh-my-zsh/completions/_foo
for it, where inside the file I have:
#compdef foo
_foo() {
echo "hello"
}
_foo
So, I expected that when I type foo [tab]
from shell I will see
$foo [tab]
hello
but instead I got
$ foo [tab]_foo
The text _foo
was just printed out after I pressed tab
.
Do you have any idea for solving this problem?