cli icon indicating copy to clipboard operation
cli copied to clipboard

Zsh autocompletion not working

Open AnuragThePathak opened this issue 2 years ago • 5 comments

Zsh autocompletion not working in Fedora 35

Hello I was trying to get completions in a cli app. I have followed instructions as provided here. I was trying to use default auto-completion only at this moment. I got the completions working in bash but in zsh it is not working.

I have set the .zshrc file as mentioned here, and the script I have downloaded to source in .zshrc is this one.

Everything seems fine to me, but still when I press tab to get completions I only get to see list of files in the directory only.

AnuragThePathak avatar Mar 18 '22 10:03 AnuragThePathak

@AnuragThePathak Did you replace the $PROG in the zsh autocomplete with the name of your binary ?

dearchap avatar Apr 24 '22 19:04 dearchap

I exported the name of the binary as PROG environment variable.

AnuragThePathak avatar Apr 25 '22 02:04 AnuragThePathak

Just a sanity check. Did you export PROG prior to sourcing the completion file?

Get Outlook for iOShttps://aka.ms/o0ukef


From: Anurag Pathak @.> Sent: Sunday, April 24, 2022 10:40:48 PM To: urfave/cli @.> Cc: dearchap @.>; Comment @.> Subject: Re: [urfave/cli] Zsh autocompletion not working (Issue #1341)

I exported the name of the binary as PROG environment variable.

— Reply to this email directly, view it on GitHubhttps://github.com/urfave/cli/issues/1341#issuecomment-1108006069, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAYNLZRIOVHOW5JD7CCBJ53VGYA3BANCNFSM5RBNSF5Q. You are receiving this because you commented.Message ID: @.***>

dearchap avatar Apr 25 '22 07:04 dearchap

Yes I did that

AnuragThePathak avatar Apr 25 '22 08:04 AnuragThePathak

can you share the snippet of .zshrc where you do this ?

On Mon, Apr 25, 2022 at 4:12 AM Anurag Pathak @.***> wrote:

Yes I did that

— Reply to this email directly, view it on GitHub https://github.com/urfave/cli/issues/1341#issuecomment-1108226313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYNLZUUOP6XV3F5ZMWKREDVGZHWBANCNFSM5RBNSF5Q . You are receiving this because you commented.Message ID: @.***>

dearchap avatar Apr 25 '22 13:04 dearchap

@AnuragThePathak I tried to reproduce this and I couldnt. I compiled a test app, set PROG to test app name and sourced the zsh_autocomplete file provided in this repo and it worked.

dearchap avatar Oct 27 '22 12:10 dearchap

Thanks for the info @dearchap. As of now, the project that needed it is archived, so anyways I am no longer concerned about it.

AnuragThePathak avatar Oct 27 '22 14:10 AnuragThePathak