Zsh-autocomplete: Path completion includes './', '../' and invalid paths cause red text

Created on 28 May 2020  Â·  8Comments  Â·  Source: marlonrichert/zsh-autocomplete

Hey,
thanks for your contentiously great work. Your recent contribution make this plugin a real pleasure for daily work!
This issue here is nothing big and does not hinder the daily work. It includes two parts. But they are both pretty small and somewhat related, so I decided to make both into one.
The first are the path completion candidates ./ and ../. When the last typed character for a path is a slash, these two candidates are always there. They are annoying, because they are at the top of the list and must be jumped over to get to the "actual" candidates. Especially when your path reaches a directory with only files, the only two remaining candidates are these two. I would argue that they add no value and are more confusing and annoying than helpful.
The second issue is that if I type a "invalid" path, I get red text. If I for example cd and type a directory name wrong, I see in red letters local directory. When I do something with a path that does intentionally not exist yet, it is even worse. So in zsh typing take /tmp/new_test will show me three red lines with file, directory, file or directory.
Could you maybe elaborate why it is like this and discuss about solutions? Would
be amazing. :blush:

All 8 comments

Second issue discussed here (three red lines) also appears when you type git commit -m " which is not a problem per se but is not ideal IMO.

I cannot reproduce the first issue, not with a slash and not with a quote. Can you please update and see if still occurs for you with the latest version of the code?

Red means no completions have been found. The text lists all the types of completions it has tried. What would you like to see instead, when no completions have been found?

I cannot reproduce the first issue, not with a slash and not with a quote. Can you please update and see if still occurs for you with the latest version of the code?

I updated just this morning (CET). Where are the completion candidates from? :thinking:

Hmm. Maybe it is more a feature rather than a bug. But paths are the fallback completion right? So for example that's why @romzie gets his issue.

First "issue" : you might reproduce it by typing cd ~/.config/ and you should see that ./ and ../ are the first two suggestions

Second "issue" : I would have expected to see nothing actually but I can be discussed.

Second "issue" : I would have expected to see nothing actually but I can be discussed.

Me too. If the plugin works asynchronous then it would be something different. Then I would maybe wait for completion, but nothing happens. But maybe it would a tiny configurable options as @marlonrichert already did for other cool things.

First "issue" : you might reproduce it by typing cd ~/.config/ and you should see that ./ and ../ are the first two suggestions

Ah, it turns out I had already fixed this before you reported it, but I hadn't pushed out the relevant commit yet. Here you go. 🙂

Finally updated it today and it works. Thanks for the fix!

I still think the red text stuff could need discussion and should be maybe configurable. Do you think it is worth a new issue? Kinda depends on the async stuff.

Yes, please file a new issue for that. It's easier for me when each issue discusses only one topic.

Was this page helpful?
0 / 5 - 0 ratings