-
Notifications
You must be signed in to change notification settings - Fork 379
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
Completion for options with comma-separated values loses its prefix #240
Comments
It doesn't fail that way for me on Ubuntu 18, bash 4.4.19, current bash-completion master. Neither does tshark, it keeps the preceding comma separated completions as well.
|
Odd, perhaps it is some shell option that causes this? I reproduced the issue from the git tree with:
so it should not be caused by any form of customization. Edit: I was also able to reproduce this issue on Ubuntu 18.04 which ships with bash 4.4.18-2ubuntu1. Setting |
I tried to reproduce with the same command as you, ditto in a new shell started with |
Really strange, perhaps it is a terminal thing? I can still reproduce it from Kubuntu 18.04.1 (no updates installed): script -c "bash --rcfile <(echo 'XDG_DATA_DIRS=/nonexistent; . ./bash_completion') -x" output.txt
# Then type: "usermod -G root,systemd-<TAB>"
# followed by Ctrl-C and Ctrl-D (exit) Over SSH or through Konsole (in the GUI) does not make a difference and produces the same output: Observe the last line: |
Here's my output for comparison. Didn't spot anything obvious in the diff on a quick look: output.txt |
Can you reproduce it with a different user on the same system? Have you set the
What is your output for |
...but I can reproduce with another user on this system. Cool, now I have something to look into when I find some time. |
It's the |
These options are available since git v2.15, but somehow eluded from the completion script. Note that while --color-moved-ws= accepts comma-separated list of values, there is no (easy?) way to make it work with completion (see e.g. [1]). [1]: scop/bash-completion#240 Acked-by: Matheus Tavares Bernardino <matheus.bernardino@usp.br> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The completion for diff command was added in fd0bc17 but missed the show command which also supports --color-moved[-ws]. This suffers from the very same problem [1] as the referenced commit: no comma-separated list completion for --color-moved-ws. [1]: scop/bash-completion#240 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 021058b tried to extend completion such that
usermod -G root,systemd-<TAB>
suggests possible completions forsystemd-
.It works when only a single candidate is available (e.g.
root,systemd-core<TAB>
->root,systemd-coredump
), but when multiple completions are available, the prefix (root,
) is dropped (e.g.root,systemd-<TAB>
->systemd-
with initially no further suggestions).This problem was first noticed when using the
tshark -O http,t<TAB>
option.Reproducer (change
XDG_DATA_DIRS
to avoid loading completions from default path):Environment:
The text was updated successfully, but these errors were encountered: