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

-bash: complete: nosort: invalid option name sourcing alacritty.bash completion file on MacOS #7949

Open
diogomatsubara opened this issue May 4, 2024 · 3 comments

Comments

@diogomatsubara
Copy link

In commit 59c63d3, the bash complete script (alacritty.bash) was changed and includes in line 368 the -o nosort option. Unfortunately that option is not available in the default bash shell shipped by MacOS (3.2.57(1)-release) and I end up getting the following message when I source the file:

-bash: complete: nosort: invalid option name

For example, projects that use the go-lang cobra command to generate the completion file (e.g. yq) take into account the bash version to enable or not the nosort option (see https://github.com/spf13/cobra/blob/v1.8.0/bash_completionsV2.go#L120-L130).

It'd be nice to have a similar logic in alacritty.bash to avoid this error.

System

OS: macOS 14.4.1 (23E224)
Version: alacritty 0.13.2 (bb8ea18)
Bash: 3.2.57(1)-release

Logs

To reproduce source the alacritty.bash on MacOS with bash 3.2.57(1)-release

$ . alacritty.bash
-bash: complete: nosort: invalid option name
@kchibisov
Copy link
Member

@chrisduerr I'm pretty sure this part of completions is also auto generated, thus it should be brought to clap?

It should likely do a version check or something and not emit the option by default. Though, macOS users better just install bash from e.g. brew, because apple don't generally care about gplv3 stuff and not sure they even security bug fix it.

@diogomatsubara
Copy link
Author

@kchibisov thanks for the quick reply!

It seems this was fixed in clap more recent version 4.5.4 clap-rs/clap@2b48858 but alacritty uses 4.4.11 (https://github.com/alacritty/alacritty/blob/master/Cargo.lock#L349)

@chrisduerr
Copy link
Member

If only macOS would actually update their software…

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

No branches or pull requests

3 participants