Skip to content
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

Autocomplete goodies #337

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Autocomplete goodies #337

wants to merge 9 commits into from

Conversation

@pacak pacak force-pushed the complete branch 2 times, most recently from a23d0ce to fc7829a Compare February 3, 2024 14:14
@ysndr
Copy link
Contributor

ysndr commented Aug 15, 2024

Hej,

Is this likely to fix issues like we see here [1]?
I.e. parsing errors "leaking" out of the completer and blocking you from doing anything except ^C and start over again?

Note in this particular case we have a -f and a -d <arg> flag both being short aliases.
I understand that -fd is not a correct argument, but in this case i'd expect arguments to -d to be completed here instead. suggesto -f=d in this case is just incorrect i'd say.

[1] flox/flox#1657

Edit: It does seem to ignore these errors now, so that's a start, but this is apparently still in progress considering the debug output it produces.

@pacak
Copy link
Owner Author

pacak commented Aug 15, 2024

I understand that -fd is not a correct argument, but in this case i'd expect arguments to -d to be completed here instead.

Even if I could start completing arguments for -d here - it won't work once you press enter and try to run the whole thing. The goal is to either move to completing the next item -fd<TAB> -> -fd _ or to break them down into separate items: -fd<TAB> -> -f -d _.

zsh with its default completion scripts support doing something smart with adjacent single letter flags, bash does not.

So yeah, I'm planning to fix this problem, but I'm not sure yet what the best solution is. Dealing with a newborn is not helping :)

@ysndr
Copy link
Contributor

ysndr commented Aug 15, 2024

Well, congratulations :)

I'm fine with it not completing if the result wouldn't be valid anyway..
Mainly hoping to get this to work without it messing up the terminal at least ^^

Is this PR the right place to start if i were to look at it myself?

@pacak
Copy link
Owner Author

pacak commented Aug 15, 2024

Well, congratulations :)

❤️

Mainly hoping to get this to work without it messing up the terminal at least ^^

Should be here, but it's a mess... Might be easier to try to address that issue directly, gimme a sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions broken in zsh if completing with a path containing ~ or an environment variable
2 participants