chrisant996/clink

Readline setting match-hidden-files off never shows completions for hidden

Closed this issue · 2 comments

Original problem

I would type the letter I and press tab and the completion would be the hidden folder .IdeaIC14, while I want the non-hidden folder IdeaProjects\

Attempted solution

I created the file C:\Users\MyUser\AppData\Local\clink\_inputrc and put:

set match-hidden-files off

Now when I complete, I get the non-hidden folder, but if I type .I and press tab, it refuses to give a completion suggestion, despite the docs saying:

If set to "off", the leading . must be supplied by the user in the filename to be completed.

Note: I tried to find a way to disable Directory Shortcuts in case that was interfering, but that doesn't seem to be possible.

Yes. The documentation text is from the Readline library. But Clink has ever actually behaved that way, because Clink doesn't use Readline's default file globbing code.

I'll implement this detail.

And the bug is broader:

When a path is included, Clink checks for . at the beginning of the path, instead of at the beginning of the filename part.

✅ When match-hidden-files is off then TAB here does not match ".git" (i.e. it functions correctly):

c:\somerepo> echo .g

❌ But when match-hidden-files is off then TAB here DOES match ".git" (i.e. it malfunctions):

c:\foo> echo \somerepo\
.git\  .gitignore  (and a bunch of other files)

❌ And when match-hidden-files is off then TAB here DOESN'T match anything (i.e. it malfunctions):

c:\somerepo> echo .git\