I have a CLI application that uses Oclif and NodeJS. I have an autocomplete script that looks like this:
# func gets called for the exec binart when Tab is pressed
# eg exec [Tab] [Tab] calls __func()
__func()
{
Perform an http request that takes 2-3 seconds
Populate COMPREPLY with autocomplete values
}
complete -o nospace -F __func exec
Since pressing Tab takes a few seconds, it would be nice to have a spinner like functionality in the shell, so that the user can see that the autocomplete is running.
How can I achieve this? Instead of a spinner a progress bar would be nice, or some dots that would indicate loading (...).