Open latipun7 opened 2 years ago
I can't reproduce this on 64bit x86, maybe it's ARM specific for some reason?
Let's try and get more specific about the offending ')'. Can you provide the output of bw completion --shell zsh | grep \)
? Here is mine:
'--cleanexit[Exit with a success exit code (0) unless an error is thrown.]' \
'(-v --version)'{-v,--version}'[output the version number]' \
'(-h --help)'{-h,--help}'[output usage information]' \
cmnds)
)
login)
logout)
lock)
unlock)
sync)
generate)
encode)
config)
update)
completion)
status)
list)
get)
create)
edit)
delete)
restore)
move)
confirm)
import)
export)
share)
send)
receive)
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-f --force)'{-f,--force}'[Force a full sync.]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-u --uppercase)'{-u,--uppercase}'[Include uppercase characters.]' \
'(-l --lowercase)'{-l,--lowercase}'[Include lowercase characters.]' \
'(-n --number)'{-n,--number}'[Include numeric characters.]' \
'(-s --special)'{-s,--special}'[Include special characters.]' \
'(-p --passphrase)'{-p,--passphrase}'[Generate a passphrase.]' \
'(-c --capitalize)'{-c,--capitalize}'[Title case passphrase.]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-p --permanent)'{-p,--permanent}'[Permanently deletes the item instead of soft-deleting it (item only).]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-f --file)'{-f,--file}'[Specifies that <data> is a filepath]' \
'(-d --deleteInDays)'{-d,--deleteInDays}'[The number of days in the future to set deletion date, defaults to 7]' \
'(-a --maxAccessCount)'{-a,--maxAccessCount}'[The amount of max possible accesses.]' \
'(-n --name)'{-n,--name}'[The name of the Send. Defaults to a guid for text Sends and the filename for files.]' \
'(-h --help)'{-h,--help}'[output usage information]' \
cmnds)
)
list)
template)
get)
receive)
create)
edit)
remove-password)
delete)
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
'(-h --help)'{-h,--help}'[output usage information]' \
Thanks for the follow up, @MGibson1 .
I don't know, I still have some error in my main laptop which is x86_64 arch.
Here's the result of bw completion --shell zsh | grep \)
:
Operating system: Arch Linux x86_64
Shell: zsh 5.8 (x86_64-pc-linux-gnu)
Build Version (run bw --version
): 1.20.0
Well swing and a miss, I guess. Those logs are the same.
Can you try again with just bw completion --shell zsh
?
It's print out normally, but error when I eval it.
I'm not sure what the difference is, I've tested completion in both mac and linux against zsh 5.8 and see no issues.
The output diffs are identical too. Do you have any extensions that may be altering expectations for completion?
This is weird, indeed. I don't know what extensions might cause this. Is this zsh extensions? Then I tried evaluating the completion from root with clean zsh profile but still no luck:
ROG# eval "$(cat /home/latipun/.local/share/omz-custom/plugins/zsh-latipun/_bw)"
zsh: parse error near `)'
I don't know if this problem only on my end. But this is occurring in my 2 (all) of my machines ...
This command is producing ANSI codes to the output. Here is what I meant:
run this: bw completion --shell zsh > _bw
so that command redirected and outputting it in _bw
file.
Here's what I got when I tried to edit that file in nvim:
That was what caused the zsh parse error.
For now, I need to strip the ANSI myself.
bw completion --shell zsh | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" > _bw
_bw
file is in fpath, now the completion is works.
I hope I don't need to strip this manually. The output of bw completion
should not produce color format / ANSI codes.
@latipun7 On my system the completions don't seem to work even though the ANSI codes are not generated by the commmand anymore, is it just me?
@BachoSeven Same issue here 😢
#compdef bw
compdef _bw bw
Added this to the top of teh completions, and it is now working for me.
I noticed another working completion file used this pattern. Don't understand it much, but gonna run with it since it's working 🤷
compdef _bw bw
source <(bw completion --shell zsh 2>/dev/null)
Those two lines in my zshrc seem sufficient.
#compdef bw compdef _bw bw
Added this to the top of teh completions, and it is now working for me.
I noticed another working completion file used this pattern. Don't understand it much, but gonna run with it since it's working 🤷
Hello,
Could you please precise this : 'Added this to the top of teh completions, and it is now working for me.' ? Because when I # run the command, eval "$(bw completion --shell zsh); compdef _bw bw;"
I obtain "zsh: command not found: compdef
" from zsh shell in macOS Sonoma (arch arm64). Thanks.
@valorisa You need compinit
enabled in your zsh config; i.e. autoload -U compinit; compinit
in your .zshrc:
@valorisa You need
compinit
enabled in your zsh config; i.e.autoload -U compinit; compinit
in your .zshrc:
Thanks
Describe the Bug
ZSH completion not working, error when evaluated. Tried to load it through
fpath
but the result compinit (.zcompdump) not contain_bw
file.Steps To Reproduce
eval "$(bw completion --shell zsh); compdef _bw bw;"
get parsing error.Tried another method:
_bw
file and place it infpath
_bw
copied from the result ofbw completion --shell zsh
autoload -Uz compinit && compinit
to rebuild the.zcomdump
Completion not loaded,
cat ~/.zcompdump | grep bw
not producing the result, which mean the file has some error then not loaded.Expected Result
No error and completion working.
Actual Result
Parse error, completion not loaded.
Screenshots or Videos
Environment
bw --version
): 2022.8.0