malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.25k stars 31 forks source link

Tab key not completing subdirectory #65

Closed dmitri-gb closed 4 years ago

dmitri-gb commented 4 years ago

In a case where I have the following Yori configuration

set YORICOMPLETELISTALL=1
set YORICOMPLETEWITHTRAILINGSLASH=1

when the first level directory is completed by pressing Tab, then it is not possible to complete the second level directory. Suggestions simply don't show up. Typing any symbol and deleting it makes completion work again.

To reproduce, first create a deeply nested directory structure, and then try changing into the innermost directory:

mkdir aaa\bbb\ccc
cd a<TAB><TAB><TAB>

I would expect that simply pressing Tab three times should be sufficient to produce the line

cd aaa\bbb\ccc\

However after completing to cd aaa\ the second Tab press does nothing. Like said, typing some character and deleting it, or even just pressing and releasing the Alt key will "fix" the situation in the sense that Tab completion will work again (for one level).

dmitri-gb commented 4 years ago

Looks like this very issue has been fixed in master (I swear the commits were not there when I created the issue 😄).

malxau commented 4 years ago

Sorry, I meant to comment here. Yes, the commit happened after the issue.

The issue is that complete with trailing slash semantics also has the subtle side effect of meaning the next tab is really scanning for new matches in the new directory. Without trailing slash semantics this doesn't happen - pressing tab completes a match, and if it's the only match, there is no further action to take in response to a later tab. This is one of those bugs that I'd have seen earlier if I ran with this mode normally...