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

ActiveHelp on bash does not handle command-line prefixes adequately #2067

Open
marckhouzam opened this issue Nov 9, 2023 · 0 comments
Open
Labels
area/shell-completion All shell completions kind/bug A bug in cobra; unintended behavior

Comments

@marckhouzam
Copy link
Collaborator

When using ActiveHelp with bash, if the program name is prefixed with a variable or similar, re-printing the command-line does not reprint the prefix.

For example, using the tanzu CLI v1.1.
Notice below that TOKEN=12345 is not shown when the command-line is reprinted. However, if I move my cursor back, the TOKEN=12345 is present but not visible.

bash-5.1$ source <(tanzu completion bash)

bash-5.1$ TOKEN=12345 tanzu context [tab]
Command help: Configure and manage contexts for the Tanzu CLI

bash-5.1$ tanzu context

Refreshing the screen (^L), will show the missing characters.

Notice that pressing [tab] a second time, if there are completion choices, will print those completion choices, and will reprint the command-line appropriately:

bash-5.1$ TOKEN=12345 tanzu context [tab]
Command help: Configure and manage contexts for the Tanzu CLI

bash-5.1$ tanzu context [tab]
Command help: Configure and manage contexts for the Tanzu CLI

bash-5.1$ tanzu context
create  (Create a Tanzu CLI context)                                   list    (List contexts)
delete  (Delete a context from the config)                             unset   (Unset the active context so that it is not used by default.)
get     (Display a context from the config)                            use     (Set the context to be used by default)
bash-5.1$ TOKEN=12345 tanzu context

The same happens with time tanzu context [tab]

@marckhouzam marckhouzam added kind/bug A bug in cobra; unintended behavior area/shell-completion All shell completions labels Nov 9, 2023
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

No branches or pull requests

1 participant