Weird behavior of a 3rd party (from a windows guy) program (related to python packaging..) confused me a little but this question might explain everything.
Sorry, I don't know pretty much anything about completions. But of course there is some information on the web. I tried to read it, but it is quite late already and I could miss something.
Basically the question is simple:
- can one put any kind of shell script in a completion,
- and they are loaded once on the start of the shell and work all the shell's lifetime aren't they?
I mean, a completion file is just a bash script, isn't it?
It just uses some additional built-in bash functions, like
complete to set up some "completion space" for the new shell.
And it happens on the start of the shell, just like with
And also completions quite often use lots of functions defined in the completion file.
When you call
complete in shell you see the list of completions with many names of those functions -- all of them are defined at the start of the shell, they are stored somewhere and they work for this shell all it's lifetime.
Is it correct?
PS And just out of curiosity, where one could look up these functions defined on the start of the shell? Are they listed somewhere, like environment variables?