-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Not adding space after dot at completion time #6928
Comments
Fish will insert a space whenever a candidate has been unambiguously accepted. If you want to then continue the token, you'll have to make longer candidates. E.g. if a command There is indeed a teensy special case for |
Thanks for the reply. I understand your consideration on the whole. Is it possible this can be customized so apps like hydra have a chance to tailor to what they need? |
The simplest solution is to generate all possible tokens, not only the thing until the next Say you have the options: foo:
bar:
baz: 1
qux: 2 You would generate two completions:
|
Hi, The flattened tree (actually trees) can be massive and it makes no sense to return the full list. I remember hitting a related problem with bash where I had to change the word break characters, removing / as a word break. Does fish support controlling the word break characters as well? |
Hmm yeah if the number of leaves in the forest is in the 5-digits, then it's probably not the best idea. There is no proper support for changing the word separators. Line 200 in 18efd7d
Extending this hard-coded list by |
Hi @krobelus. This problem caught me off guard: I have a pretty solid comprehensive test suite for the completion and it misses it. (The testing I have is another reason I would like a behavior change: I have a single test suite I am running for bash and now for fish, and in the future for other shells as completion plugins are implemented. I will want to add some more tests that are testing the case for two consecutive completions in various cases to be sure there isn't anything else. I suspect adding '.' to that list would address my needs though. I also need / and = for a different kind of completions, it's good to see those are covered, and I am actually thinking about using @ as a part of the syntax in the future so great to see it here as well. Are there any thoughts about allowing the control of those work break characters through an environment variable? (FISH_WORD_BREAK?) |
Two thoughts: That would be quite unfishy, and a global option would be entirely unsuited here. As you've said, all your needs are covered by adding the two additional characters, and fiddling with low-level crap like this isn't something we want to subject our users to. Adding a knob here would make things worse, not better. If it does become apparent that more is needed (and it doesn't seem like it currently) we should add a flag to |
I see, you are even simulating an interactive process with
It's a very specific hack only affecting completions, not any other word splitting so this has potential for confusion. Once it doesn't cut it anymore we should instead add a new flag to |
I remember I looked at pexpect briefly and decided against it, can't remember why. I think it was not exactly following the behavior expected (Pun!) by Expect, can't remember what was the issue though.
Gotcha. |
Thanks @krobelus! @binshengliu, can you build fish from master and check your completion plugin with the updated fish? |
Hi, I'm implementing fish completion for hydra. It is a framework to manage configuration key/values in a hierarchical style. For example to specify a configuration from command line is like
./script.py db.name=sqlite
. It also has support for dynamic completion so I'm integrating it with fish using dynamic completion:complete -c test.py -x -a '(test.py -sc query=fish --_completion (commandline -cp))'
, following an earlier discussion.The problem is fish automatically adds a space after candidates ending with a dot
.
. Completing./script [TAB]
results in./script db.
. For further completion the user needs to delete the space and press TAB again. But for=
it works as expected. (asciinema recording: https://asciinema.org/a/322303)I'd like to suggest that space is not added after
.
like the behaviour for=
, so the dot can also be used as a separator in such scenarios.Environment:
The text was updated successfully, but these errors were encountered: