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

[cobra] Breaks gh tab completion #183

Closed
SuperSandro2000 opened this issue Apr 4, 2022 · 4 comments
Closed

[cobra] Breaks gh tab completion #183

SuperSandro2000 opened this issue Apr 4, 2022 · 4 comments

Comments

@SuperSandro2000
Copy link

ble version: 0.4.0-devel3+8940434
Bash version: 5.1.8(1)-release (x86_64-pc-linux-gnu)

blesh tab completion breaks the gh one. The program has its own menu style tab completion which gets inserted. I have tested this with gh 2.6.0. I think it is using cobra. Maybe this can be generally fixed for all programs that use cobra?

image

@akinomyoga
Copy link
Owner

The description seems to have been introduced in spf13/cobra#1146. There was a fix to avoid adding descriptions in the menu completion, etc. of Bash in spf13/cobra#1509. I guess we can intercept this function, but the problem is that cobra seems to dynamically generate the function name for each command. We might detect the completion function name __start_* for cobra BashCompletionV2.

@akinomyoga
Copy link
Owner

akinomyoga commented Apr 4, 2022

71d0736 I have pushed a workaround. Could you check if it works correctly?

@SuperSandro2000
Copy link
Author

Works now. Thank you!

@akinomyoga
Copy link
Owner

Thank you!

@akinomyoga akinomyoga changed the title Breaks gh tab completion [cobra] Breaks gh tab completion Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants