Giter Club home page Giter Club logo

Comments (5)

MikeMcQuaid avatar MikeMcQuaid commented on June 3, 2024 1

Another potential option here: given it looks like detection is not really possible maybe these could just be output a single time regardless of how many formulae are installed/upgraded at the end of all installations?

from brew.

jubr avatar jubr commented on June 3, 2024

Looks like for detection if it has been run in the current shell could be by inspecting BASH_COMPLETION_VERSINFO. Assuming there's similar vars for zsh, fish, etc.

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on June 3, 2024

Looks like for detection if it has been run in the current shell could be by inspecting BASH_COMPLETION_VERSINFO. Assuming there's similar vars for zsh, fish, etc.

@jubr Can you investigate this more? If we can automatically detect if this message is redundant I agree it may make sense to remove these messages.

HOMEBREW_CAVEAT_COMPLETIONS with future values like suppress, show, suppress-when-detected-in-shell.

Going from "no configuration" to "four different settings" feels excessive. Let's focus on the problem to be solved for now and we can figure out what's best based on what's e.g. possible from the shell.

from brew.

cho-m avatar cho-m commented on June 3, 2024

Looks like for detection if it has been run in the current shell could be by inspecting BASH_COMPLETION_VERSINFO

I don't think that is available in bash-completion (v1) for system bash users. This has more installs than bash-completion@2 in last 90 days and last 365 days.

Some tricky parts for shell detection:

  1. brew is a bash script. Not sure if possible to see corresponding zsh (e.g. fpath/FPATH/_comps) and fish (e.g. fish_complete_path) variables.
  2. brew sanitizes the environment. By the time caveats are printed, the BASH_* variables have been removed from environment.

From quick glance, a suppress-when-detected-in-shell feature wouldn't be possible other than maybe brew fish (since we don't need variables there other than particular shell).

If so, the options would then be a full opt out flag or maybe some sort of show-once-per-formula if we could store info in tab.

from brew.

bartekpacia avatar bartekpacia commented on June 3, 2024

I just stumbled upon this issue and would like to express my opinion: as a Homebrew user, I really like when I brew install something and see "zsh completion has been installed". I just really like shell completions. I think it's a good default to print information about installing completion files.

I agree with #2110 that "Caveats" is not maybe the best place for it, though.

from brew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.