Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

tab completion not working in zsh #214

Closed
meredrica opened this issue Nov 10, 2022 · 5 comments · Fixed by #216
Closed

tab completion not working in zsh #214

meredrica opened this issue Nov 10, 2022 · 5 comments · Fixed by #216
Assignees
Labels
bug Something isn't working

Comments

@meredrica
Copy link

hi!

Tab completion for file names seems to be broken in zsh
steps:

cd /tmp/
echo 'some text' > README.md

then try to autocomplete the README.md

$ mdcat --version
mdcat 0.29.0
@swsnr
Copy link
Owner

swsnr commented Nov 10, 2022

I can't help you; I do not use zsh.

I'm sorry but you need to debug and fix this yourself. Pull requests are welcome.

@swsnr swsnr added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2022
swsnr added a commit that referenced this issue Nov 28, 2022
We used to generate completions for the top-level command, but that's
not correct in a multicall binary: It includes the subcommands as
completable arguments, whereas we actually need to split completions per
subcommand.

Hence, iterate over the two relevant subcommands aka binary names, and
separately generate the completion for each corresponding subcommand.

This corrects completions for mdcat, and as a bonus we now also generate
completions for mdless which we didn't have before.

Closes GH-214

[ci skip]
@swsnr swsnr removed the help wanted Extra attention is needed label Nov 28, 2022
@swsnr swsnr self-assigned this Nov 28, 2022
swsnr added a commit that referenced this issue Nov 28, 2022
We used to generate completions for the top-level command, but that's
not correct in a multicall binary: It includes the subcommands as
completable arguments, whereas we actually need to split completions per
subcommand.

Hence, iterate over the two relevant subcommands aka binary names, and
separately generate the completion for each corresponding subcommand.

This corrects completions for mdcat, and as a bonus we now also generate
completions for mdless which we didn't have before.

Closes GH-214
swsnr added a commit that referenced this issue Nov 28, 2022
We used to generate completions for the top-level command, but that's
not correct in a multicall binary: It includes the subcommands as
completable arguments, whereas we actually need to split completions per
subcommand.

Hence, iterate over the two relevant subcommands aka binary names, and
separately generate the completion for each corresponding subcommand.

This corrects completions for mdcat, and as a bonus we now also generate
completions for mdless which we didn't have before.

Closes GH-214
swsnr added a commit that referenced this issue Nov 28, 2022
We used to generate completions for the top-level command, but that's
not correct in a multicall binary: It includes the subcommands as
completable arguments, whereas we actually need to split completions per
subcommand.

Hence, iterate over the two relevant subcommands aka binary names, and
separately generate the completion for each corresponding subcommand.

This corrects completions for mdcat, and as a bonus we now also generate
completions for mdless which we didn't have before.

Closes GH-214
@swsnr
Copy link
Owner

swsnr commented Nov 28, 2022

@meredrica I think I've found the issue, see #216

I'll make a new release with this fix soon; I'd appreciate testing 🙂

@swsnr swsnr closed this as completed in 1c41114 Nov 28, 2022
@swsnr
Copy link
Owner

swsnr commented Nov 29, 2022

@meredrica 0.30.0 is out, with a change which hopefully fixes this issue. Let me know if you still have issues with completion.

@meredrica
Copy link
Author

Hi!

Will do asap and get back to you

@meredrica
Copy link
Author

@swsnr can confirm, working now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants