jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Set up completions automatically

Open quintesse opened this issue 3 months ago • 6 comments

When reading the description for the new 0.1.130 release I saw this:

Meaning jbang will now install it on PATH when using fish shell, and you can do: just jbang completion -s fish > ~/.config/fish/completions/jbang.fish

And I wondered if we could perhaps do that automatically (including for bash and zsh of course)? Because I always forget how to set up completions so I never do it.

quintesse avatar Sep 10 '25 10:09 quintesse

We could but not a fan if we can't make it work less obtrusive than our current shell setup.

Atm we always write bash, zsh and fish even if you only use one of them.

We could make 'jbang completion setup' a thing?

maxandersen avatar Sep 10 '25 11:09 maxandersen

But can't we simply set up the completions when doing the shell setup?

quintesse avatar Sep 10 '25 13:09 quintesse

Yes but that's the thing - we generate them all ...wether you need them or not.

maxandersen avatar Sep 10 '25 14:09 maxandersen

But is that a problem?

Edit: given the fact that people can often switch between shells (not always voluntarily) I don't think it's a bad idea that a user's system is prepared to work with JBang regardless of the shell they're using (now or in the future).

quintesse avatar Sep 10 '25 18:09 quintesse

Well i got a poc for nutshell too - but afaik i don't think other clis leave a trail of N shell configs..:)

maxandersen avatar Sep 10 '25 20:09 maxandersen

I actually think they do. I've not set up sdkman for multiple shells for example but it's still in both .bashrc and .zshrc on my system. But it may be that they only do that for shells that are actually installed. We could do the same (except perhaps always install for bash)

quintesse avatar Sep 10 '25 22:09 quintesse