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

can someone advice why bash completion does not work? #491

Open
alfonz19 opened this issue Dec 24, 2022 · 9 comments
Open

can someone advice why bash completion does not work? #491

alfonz19 opened this issue Dec 24, 2022 · 9 comments

Comments

@alfonz19
Copy link

In instalation text:

If you use a Bash-compatible shell, you can install the watson.completion file from the source distribution as /etc/bash.completion.d/watson - or wherever your distribution keeps the Bash completion configuration files. After you restart your shell, you can then just type watson on your command line and then hit TAB to see all available commands.

First pip install --user td-watson then ... file from source distribution? Where, what?

Ok, so I went with development version, installed it, copied bash completion as instructed, I trying to debug why it's not working I just added logging:

_watson_completionetup() {
  echo 'registered'>>/tmp/watson_setup

and

_watson_completion() {
    local IFS=$'
'
    COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
                   COMP_CWORD=$COMP_CWORD \
                   _WATSON_COMPLETE=complete $1 ) )
    echo "$COMPREPLY" >> /tmp/watson_setup
    return 0
}

restarted bash, and I see, that 'registered' appears in file as expected, but COMPREPLY is always logged as empty string. I'm no bash expert, but I cannot see in completion script neither any list of supported actions nor call to watson to get one.

what am I doing wrong?

@siiky
Copy link

siiky commented Dec 30, 2022

Second, Bash completion doesn't work with Watson 2.1.0 for me. I have it in ~/.local/share/bash-completions/completions/watson, and it used to work on the previous version.

I confirmed just now that the completion file hasn't changed in a few years, so I'm wondering if this is due to the recent click version bump...

@alfonz19
Copy link
Author

what is "click version bump?"

@siiky
Copy link

siiky commented Jan 3, 2023

This is what I mean: b2068f6.

click is the library used for the CLI (easier to generate help text, autocompletion, etc).

@Issam2204
Copy link

I confirm this. Autocompletion doesn't work.

@bewuethr
Copy link

Tab completion is broken for me, too, though I'm fairly sure it was working until recently (and definitely after May 2022).

@toheine
Copy link

toheine commented Feb 20, 2023

Same behavior in my environment. Would be great if I can use the autocomplete again in the future.

@addisonklinke
Copy link

Confirmed that downgrading to td-watson==2.0.1 resolves the bash completion. A couple notes regarding this process

  1. brew only has the latest, so you have to resort to pip-install on a Mac
  2. pip still pulls click>8 by default, so I had to override that with the old spec click>=7.0,<8.0 which resulted in 7.1.2

@YoungMahesh
Copy link

Confirmed that downgrading to td-watson==2.0.1 resolves the bash completion. A couple notes regarding this process

  1. brew only has the latest, so you have to resort to pip-install on a Mac
  2. pip still pulls click>8 by default, so I had to override that with the old spec click>=7.0,<8.0 which resulted in 7.1.2

Executed these two commands on my ubuntu to achieve downgrade of td-watson and click package, after which bash completion starts working:
1, pip install td-watson==2.0.1
2. pip install click==7.1.2

@stbazsa
Copy link

stbazsa commented Nov 3, 2023

Bash completion works using this previous version of the 'watson.completion' file. Just put this file to /etc/bash_completion and it will work again with the latest (2.1.0) release.

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

9 participants