-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 error - invalid regex : ) #5098
Comments
Tried on a different machine (22.04 on WSL) - found the same error happened there because I accidentally installed "beet", though it appeared after throwing some errors for missing commands - it works fine on that machine now. The first machine does not have the incorrect package. The working Working
|
Same here with
|
To clarify, the You can check whether this works on your machine by executing this snippet from the completion code in the shell directly: beet help | awk -v SEP=" " -v ARG2="3" -v START="Commands:" -v END2="" 'BEGIN {if(START==""){f=1}{f=0};
if(ARG2 ~ "^[0-9]+"){LINE1 = "^[[:space:]]{0,"ARG2"}[^[:space:]]"}else{LINE1 = ARG2}}
($0 ~ END2 && f>0 && END2!="") {exit}
($0 ~ START && f<1) {f=1; if(length(START)!=0){next}}
($0 ~ LINE1 && f>0) {if(f<2){f=2; printf("%s",$0)}else{printf("\n%s",$0)}; next}
(f>1) {gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); printf("%s%s",SEP, $0); next}
END {print ""}' This should output a non-empty list like this:
The exact contents of the list may be different for you, depending on the plugins you have installed. If sub-commands are listed correctly in the shell, you should check that the completion code is loaded from the correct location. In a freshly started shell (before invoking or completing the |
That produces an empty list on my machine:
and my
So now I guess I've got to figure out why it's not producing any output. |
Here is a suggestion, how to narrow down the cause of the problem. First, test that the output of
The Next, you could check, if a simpler regular expression to distinguish deeply indented lines works better for you. The following shell command sets
This should output the help text from above with only a single (long) line for each sub-command. |
That second regex produces output:
|
That was helpful in identifying the root cause of the problem! According to https://github.com/ThomasDickey/mawk-snapshots/blame/master/man/TODO only Before I submit another pull request for the The fix basically replaces the former |
Unless I'm missing something, which is extremely likely, it doesn't seem to help?
|
It is probably necessary to launch a fresh shell after replacing the
Completion functions are usually auto-loaded by |
Exactly the same after running the above and rebooting the machine. |
Then let's check whether the updated regex works, if directly used in the shell:
This should list all sub-commands of If this works, the next step would be to check the output of |
It works directly from the shell, as in the output is the list of subcommands with the short description. AFAICT the only
There are several paths listed, but from the above I don't think it's getting loaded from another location?
As you say,
At least I don't think it is. |
I tried installing
and later than the 20200717 verison that you mention above, yet that has the same problem with both the package provided |
Also updating the whole machine to Trixie results in the same behaviour... This machine is just a small VM that I use for managing my music library, initially I used an Arch VM but got fed up with the constant updates. As such I switched over to Debian for a more stable base, however I only ran into this issue on Debian. As such I'm wondering if I should deal with the updates on Arch as I didn't run into this issue there... |
So the regex for the sub-commands seems to be ok and I also do not see any possibility to load another, unexpected When searching my home directory for relevant dot-files, I have found a cached copy of the generated I have no specific idea, how this could happen, but since the file is regenerated on demand, it cannot hurt to delete any cached files related to completion of the |
I had same issue, following those commands fixed it, except that I reopen the terminal before |
Problem
Using the latest (c153f72) version of _beet still produces the invalid regex error.
I have
mawk
installed, which according to #3546 (comment) should have avoided this issue in the previous version, but it's present in both versions.Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: