Why Tab in session requires pressing more than once

If using Tab to complete or suggest something, often it is required to do so more than once. Why?

How can it be fixed?

My understanding is that you need two TABs when there are multiple possible completions. eg one TAB completes \alph to α, but after \a you need two to see the list of possibilities.

I think of it as a feature, not a bug.

2 Likes

Hmmmm, I was under the impression that one Tab would immediately complete if only one possibility was found, and that one Tab would also give all relevant possibilities if more than one was found (which seemed very obvious to me).

If it is a feature, why is it like that?

I can imagine that it might be good in some cases.

I don’t know the history of this feature. Personally, I like it because it gives me an opportunity to add other characters to pin down the symbol name before cluttering the console.

Cf completion in most shells (eg bash/zsh), which AFAICT does this for the first tab (though I am sure that zsh can be configured to do what Julia does, but never bothered).

In any case, if this is important to you, check if there is an existing issue and maybe open one. I guess that getting completions after the first tab is a valid preference.

Yes, I also thought of the possibility of not cluttering the screen. It seems like a good thing.

I think I will leave it for now.

I did notice that sometimes it took long before Tab completion even did anything at all. It sometimes took long before the session was noticeably active again and usable by direct user activity. Does it have to do with compilation or anything like that, or not? It doesn’t always happen.

The way I think of it is, “one tab to complete as far as possible, two to see possible completions.” Usually, if you have eg my_variable1 and my_variable2, then type my_v<tab>, it will autocomplete to my_variable. Then you press it again to see the options. When the very next character is ambiguous, one tab still does the same thing - it completes as far as it’s able, which is no further.

1 Like