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

Unexpected autocomplete behaviour #502

Open
Kaarel opened this issue Jun 16, 2022 · 4 comments
Open

Unexpected autocomplete behaviour #502

Kaarel opened this issue Jun 16, 2022 · 4 comments

Comments

@Kaarel
Copy link

Kaarel commented Jun 16, 2022

Added the output of nats --completion-script-bash to my .bashrc

Works awesome! with some caveats :)

  • nats r - prints reply request restore rtt ✅
  • nats s - autocompletes to nats seal ❌
  • nats st - does nothing ❌
  • nats str - does nothing ❌
  • nats stre - autocompletes to nats stream ✅
@Kaarel Kaarel changed the title Unexpected autocoplete behaviour Unexpected autocomplete behaviour Jun 16, 2022
@sylr
Copy link
Contributor

sylr commented Jun 28, 2022

With zsh it only autocompletes the first word and then is for the second word it proposes the list of first words:

 ✘ sylvain $ nats stream <tab>
account    backup     bench      consumer   context    errors     events     governor   help       kv         latency    object     publish    reply      request    restore    rtt        schema     server     stream     subscribe

@sylr
Copy link
Contributor

sylr commented Sep 8, 2022

@ripienaar any chance someone could look into that ? it's pretty annoying.

@ripienaar
Copy link
Collaborator

Agree, quite annoying, but I havnt had time to investigate sorry, help would be appreciated since it's such a infrequently used feature.

The behavior is somewhere deep in the CLI library, I did see there's some hints I can do to help it out but havnt investigated actualy using them.

@philpennock
Copy link
Member

philpennock commented Nov 7, 2022

(zsh-specific for @sylr's issue, does not address the bash issue)

The Synadia installer for client tools provides https://get-nats.io/zsh.complete.nats aka https://github.com/ConnectEverything/client-tools/blob/main/zsh.complete.nats

That wrapper manages to invoke the CLI-bundled completion interfaces correctly enough that you don't see the issue. But it's not auto-updated along with the client binary. Still, it works today. There's also a zshrc with some copiously-commented examples of things like setting up tab-completion for NATS_CONTEXT using the completion function.

Download https://get-nats.io/zsh.complete.nats to be called _nats somewhere in your $fpath list and restart zsh to get fresh completion and see if that helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants