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

Failure with bash completion v2 and bash v3 #1734

Closed
marckhouzam opened this issue Jun 20, 2022 · 0 comments · Fixed by #1735
Closed

Failure with bash completion v2 and bash v3 #1734

marckhouzam opened this issue Jun 20, 2022 · 0 comments · Fixed by #1735
Labels
area/shell-completion All shell completions kind/bug A bug in cobra; unintended behavior

Comments

@marckhouzam
Copy link
Collaborator

With the merge of the ActiveHelp feature (#1482) I started seeing errors in the tests of https://github.com/marckhouzam/cobra-completion-testing for bash v3 when using descriptions.

Testing things manually:

bash-3.2# ./testprog __complete d
dasharg	Wants argument --arg
dir	Directive: subdir
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
bash-3.2# ./testprog d
dasharg^IWants argument --arg dir^IDirective: subdir

We can see that the tab character that delimits a description gets somehow mistakenly converted to a ^I, which breaks the proper display of completion descriptions.

I will be posting a PR to fix this.

marckhouzam added a commit to marckhouzam/cobra that referenced this issue Jun 20, 2022
Fixes spf13#1734

Tab characters that introduce completion descriptions weren't properly
being handled with bash v3.  This change fixes that.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
marckhouzam added a commit that referenced this issue Jun 20, 2022
Fixes #1734

Tab characters that introduce completion descriptions weren't properly
being handled with bash v3.  This change fixes that.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
@marckhouzam marckhouzam added kind/bug A bug in cobra; unintended behavior area/shell-completion All shell completions labels Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/shell-completion All shell completions kind/bug A bug in cobra; unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant