I have an autocompletion bash function that accesses a database to provide possible terminations of the current command line in bash. It takes about 3 seconds to complete, and during this time the user has no indication that he caused autocomplete, prompting him to press TAB again, which will lead to the fact that autocomplete may be launched several more times.
Is it possible to manipulate the command line to show that something is being done as soon as autocomplete begins? For example, when I press TAB twice after the foo command, I would like to immediately do the following:
$ foo autocompleting...
and then after the possible completions are determined, change to:
$ foo bar baz jazz
Alternatively, if I type foo j and press TAB once, the following:
$ foo j autocompleting...
should be changed to
$ foo jazz
without additional text under it, as expected.
The next step would be to consider the possibility of obtaining dynamic output when starting autocomplete, for example, printing characters \ | / - \ | / - in one place, as if the line rotated in place - visually indicate that something is happening. Is it possible?
bash autocomplete
Irfy
source share