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

Completions crash in fish #93

Open
MrGreenTea opened this issue Nov 23, 2020 · 6 comments
Open

Completions crash in fish #93

MrGreenTea opened this issue Nov 23, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@MrGreenTea
Copy link

MrGreenTea commented Nov 23, 2020

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. open fish
  2. bit complete
  3. check ~/.config/fish/completions/bit.fish
  4. type bit <TAB>
  5. wait and hit Ctrl+C
  6. get something like this
❯ bit
\e[0;39;49m\e]2;\cg\e[J                                                                                                                                                                        
\e[?25l\e[0;93;49m> bit \e[0;39;49m\e[0;39;49m\e[0;39;49m\e[J\eD\eD\eD\eD\eD\eD\eM\eM\eM\eM\eM\eM\e[0;97;46m\e[1B\e[0;90;103m status                      \e[0;97;40m Show the working tree st…
COMP_LINE bit   COMP_POINT  err: strconv.Atoi: parsing "": invalid syntax

Expected behavior
Get an overview/completion of all bit commands

Desktop (please complete the following information):

The installed completions file in ~/.config/fish/completions/bit.fish looks like this:

function __complete_bit
    set -lx COMP_LINE (commandline -cp)
    test -z (commandline -ct)
    and set COMP_LINE "$COMP_LINE "
    /usr/local/bin/bit
end
complete -f -c bit -a "(__complete_bit)"
@MrGreenTea MrGreenTea added the bug Something isn't working label Nov 23, 2020
@owarai
Copy link

owarai commented Feb 5, 2021

Is this work for you? #3 (comment).

@MrGreenTea
Copy link
Author

Is this work for you? #3 (comment).

Yes after set -Ux COMP_POINT 1 it seems to work perfectly.

@lepinkainen
Copy link

"Me-tooing" this. Had the exact same error as in #3 setting COMP_POINT fixed it.

@MrGreenTea
Copy link
Author

setting COMP_POINT to 1 has other weird behaviour for me, where it only shows subcommands starting with b and also showing subcommands that do not exist.

setting COMP_POINT to 4 at least gets me all subcommands.

@c0state
Copy link

c0state commented May 21, 2021

Not super familiar with all this but using set -lx COMP_POINT (commandline -C) seemed to fix this issue for me. For reference, kubernetes-sigs/kustomize#2561 (comment)

@rverst
Copy link

rverst commented Oct 13, 2021

If I add the line @c0state suggested to the bit.fish completion script I get the full list of available commands. And it works with partial completions as well, e.g. typing bit st and then hitting tab.

But I miss the usual explanation of the commands:
snip2

vs:
snip1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants