-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary tilde expansions supersede directory and file completions #741
Comments
Note that there is a related issue involving expansion suggestions for backslash-escaped words/paths as well as quoted words. This interferes with completing paths containing spaces, as the first suggestion is always to remove the escapes (which would break the path). |
Your fix works for me as well - was getting annoyed by this. Thanks! |
@aaronkollasch I was about to open an issue for that, I was just checking if there is already an issue for this? is there any temporary fix? a lot of my paths contain spaces, so it's getting very annoying |
@4rtemis-4rrow Here's a temporary fix for the spaces issue - It's not perfect in covering all the edge cases that could happen with quotations and escapes, but it does reduce the annoyance level: aaronkollasch@d53d90d |
Looks like expansions can be disabled in config as per #759:
|
I find expansions useful enough that I want to keep it, but that is another solution if you don't. |
@aaronkollasch kinda off-tangent, but what else, apart from i switched to your fork for a bit because i didn't want to miss out on them,,,but i just tried this and....it looks fine...maybe i'm just not noticing something i use is gone.. |
@poopsicles The other things are expanding glob expressions ( |
@aaronkollasch yesssss, globs how could i forget lolll they're so useful, i use them all the time thanks! (both for your fork with a workaround and the explanation) |
Environment
Steps to reproduce
So the first suggestion is an expansion of
~
followed by the portion of the subdirectory. Because the expansion takes priority, it takes two tabs to get to the first directory completion instead of one. The problem repeats, as if I accept~/aaa_1
by typing '/', the new first completion is again the tilde expansion, and it's the full path ofaaa_1
, the folder I've already entered!This means that to efficiently complete
~/*
paths, I must first expand the~
, which clutters up the terminal and requires extra keystrokes.Contents of
~autocomplete-log/YYYY-MM-DD.log
(click to expand)Potential solution
Using bisection, I traced the issue to commit 0643189.
The solution I came up with was to expand the first path component of
$word
if it begins with~
, before comparing with the full$expansion
.It feels a bit hack-y but I'm not sure if there's a better way, such as directly disabling tilde expansion in eval or something.
Note that due to the way I used patterns here, completing
~
still suggests the expansion into$HOME
as the first result, it just goes away for~/
or~/a...
and beyond. Seems like a useful middle ground for my purposes.See this commit for the diff: aaronkollasch@da40b54
The text was updated successfully, but these errors were encountered: