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

zsh completion doesn't add space after choose a word #35

Closed
Sherlock-Holo opened this issue Nov 1, 2023 · 4 comments
Closed

zsh completion doesn't add space after choose a word #35

Sherlock-Holo opened this issue Nov 1, 2023 · 4 comments

Comments

@Sherlock-Holo
Copy link

prctl [<GLOBAL-OPTION>]...;

prctl [<GLOBAL-OPTION>]... cg "cgroups related commands" list "list prctl creates cgroups";
prctl [<GLOBAL-OPTION>]... cg "cgroups related commands" create "create a cgroup by name" [(-h | --help) "Print help"] <PATTERNS>...;
prctl [<GLOBAL-OPTION>]... cg "cgroups related commands" delete "delete a cgroup by name" [(-h | --help) "Print help"] <CGROUPS>...;
prctl [<GLOBAL-OPTION>]... cg "cgroups related commands" show "show cgroup control processes" [(-h | --help) "Print help"] <CGROUPS>...;
prctl [<GLOBAL-OPTION>]... process "process related commands" move "move pids to specify cgroup" [(-h | --help) "Print help"] <CGROUPS> <PIDS>...;

<GLOBAL-OPTION> ::= (-t <CGROUP_TYPE>) "[default: v2] [possible values: systemd, v2]"
                    | (--pause-path <PATH>) "pause path"
                    | (-h | --help) "Print help";

<CGROUPS> ::= {{{ prctl cg list }}};
<CGROUP_TYPE> ::= (systemd | v2);

that's my usage file, when I compile and source it in zsh, input prctl c then press , it show complete the cg` and add a space after the word, but it doesn't

@adaszko
Copy link
Owner

adaszko commented Nov 11, 2023

Hi! This is a known limitation. Until zsh allows for calling _describe function twice to specify completions, I don't think it can be fixed on the complgen side.

See comment from _describe sources:

% run-help _describe
_describe is a shell function from /opt/homebrew/Cellar/zsh/5.9/share/zsh/functions/_describe
% head /opt/homebrew/Cellar/zsh/5.9/share/zsh/functions/_describe
[...]
# ### Note: Calling this function twice during one completion operation, such
# ### that in each call there exists a pair of items having the same description
# ### as each other, and the two calls specify the same $_type, currently leads
# ### to garbled output; see workers/35229 (May 2015) and its thread (which also
# ### discusses at least two other issues, that may or may not be related to
# ### this one).
[...]

@adaszko
Copy link
Owner

adaszko commented Nov 15, 2023

I pushed a commit with an alternative trailing space handling in JIT mode proving there's a way after all. It still needs to be ported to the AOT mode though.

@adaszko
Copy link
Owner

adaszko commented Dec 3, 2023

Check with latest master please. This should now behave properly.

@adaszko
Copy link
Owner

adaszko commented Dec 7, 2023

Fix included in the latest release.

@adaszko adaszko closed this as completed Dec 7, 2023
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

No branches or pull requests

2 participants