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

Brew commands autocomplete doesn't work #17341

Closed
3 tasks done
dbzix opened this issue May 21, 2024 · 5 comments
Closed
3 tasks done

Brew commands autocomplete doesn't work #17341

dbzix opened this issue May 21, 2024 · 5 comments
Labels
bug Reproducible Homebrew/brew bug

Comments

@dbzix
Copy link

dbzix commented May 21, 2024

brew doctor output

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  cointop
  openssl@1.1

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

$ brew config
HOMEBREW_VERSION: 4.3.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: e0bc557e7b991cb23583679e1cf1c8a92b793aeb
Last commit: 23 hours ago
Core tap JSON: 21 May 08:04 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: /bin/nano
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.1 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: octa-core 64-bit haswell
Clang: N/A
Git: 2.45.1 => /bin/git
Curl: 7.81.0 => /bin/curl
Kernel: Linux 6.5.0-28-generic x86_64 GNU/Linux
OS: Linux Mint 21.3 (virginia)
Host glibc: 2.35
/usr/bin/gcc: 11.4.0
/usr/bin/ruby: 3.0.2
glibc: N/A
gcc@11: N/A
gcc: 14.1.0
xorg: N/A

What were you trying to do (and why)?

Trying to have brew commands autocompletion.

What happened (include all command output)?

Autocompletion for brew commands doesn't work.

What did you expect to happen?

Autocompletion for brew commands works.

Step-by-step reproduction instructions (by running brew commands)

`brew inst<TAB><TAB>` - nothing happens.
`brew un<TAB><TAB>` - nothing happens.
`brew upd<TAB><TAB>` - nothing happens.
`brew upg<TAB><TAB>` - nothing happens.
`brew doc<TAB><TAB>` - nothing happens.
etc.
@dbzix dbzix added the bug Reproducible Homebrew/brew bug label May 21, 2024
@dbzix dbzix changed the title Brew commands autocomplete Brew commands autocomplete doesn't work May 21, 2024
@MikeMcQuaid
Copy link
Member

Did you read/follow https://docs.brew.sh/Shell-Completion?

@dbzix
Copy link
Author

dbzix commented May 21, 2024

@MikeMcQuaid Yes, and it didn't help.
I've also tried to install bash-completion, but received:

$ brew install bash-completion
==> Downloading https://ghcr.io/v2/homebrew/core/bash-completion/manifests/1.3_3
Already downloaded: /home/username/.cache/Homebrew/downloads/1ce2e9e615402b0a5be101ea0e04880736e2c985e09ed8f1d8d30ff4c287f07e--bash-completion-1.3_3.bottle_manifest.json
==> Fetching bash-completion
==> Downloading https://ghcr.io/v2/homebrew/core/bash-completion/blobs/sha256:c34ba8272f8e85e7f453c76e0fee07d8d35831e6b6365588a80ef240f9524e50
Already downloaded: /home/username/.cache/Homebrew/downloads/47556009459bddbe9164f34869ebd3e8dd8810870db74213e5de1850875a08f4--bash-completion--1.3_3.x86_64_linux.bottle.tar.gz
Error: Cannot install bash-completion because conflicting formulae are installed.
  util-linux: because both install `mount`, `rfkill`, and `rtcwake` completions

Please `brew unlink util-linux` before continuing.

Unlinking removes a formula's symlinks from /home/linuxbrew/.linuxbrew. You can
link the formula again after the install finishes. You can `--force` this
install, but the build may fail or cause obscure side effects in the
resulting software.

Installing bash-completion@2 didn't help, too.

UPD.: Also, the page you provided says:

Homebrew comes with completion definitions for the brew command.

I suppose it assumes that for brew command completions there is nothing that should be done additionally. Am I wrong here?

@MikeMcQuaid
Copy link
Member

@MikeMcQuaid Yes, and it didn't help.

What steps did you follow, what did they output, what else have you tried, what shell are you using, etc.

@dbzix
Copy link
Author

dbzix commented May 21, 2024

Hey, @MikeMcQuaid!
I finally resolved the issue by running brew completions link and then adding the piece of script mentioned here to my .bashrc file.

The problem was obviously in blindly following the suggestion to add this script to either .bash_profile or .profile.
So, anyway, thanks for trying to help.

But I would like to make a little proposal here.
It would be nice and simple for users to have something like eval "$(brew init bash)" just as some other tools do. And you just put it right in your config file specific to the shell you use.

@dbzix dbzix closed this as completed May 21, 2024
@MikeMcQuaid
Copy link
Member

@dbzix glad you got it resolved.

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

No branches or pull requests

2 participants