Skip to content

Fix shellenv INFOPATH missing the default in fish - #23059

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
jdelStrother:fish-infopath
Jul 28, 2026
Merged

Fix shellenv INFOPATH missing the default in fish#23059
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
jdelStrother:fish-infopath

Conversation

@jdelStrother

@jdelStrother jdelStrother commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Previously, brew shellenv in fish would generate a single-element array ('/opt/homebrew/share/info'), meaning that emacs and co wouldn't look up their own built-in info dirs. INFOPATH ought to include a trailing colon to allow this, so we now generate a two-element array in fish ('/opt/homebrew/share/info','')


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

Claude fable helped me narrow down why emacs was behaving weird. The code change is me.


Previously, this would generate a single-element array ('/opt/homebrew/share/info'), meaning that emacs and co wouldn't look up their own built-in info dirs.
INFOPATH ought to include a trailing colon to allow this, so we now generate a two-element array in fish ('/opt/homebrew/share/info','')
Copilot AI review requested due to automatic review settings July 11, 2026 08:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates brew shellenv’s fish-shell output to ensure INFOPATH preserves the default Info search directories (by ensuring a trailing : semantics via an empty list element), addressing cases where tools like Emacs won’t search their built-in Info dirs.

Changes:

  • Document the intended INFOPATH trailing-colon behavior.
  • Update fish shellenv output to initialize INFOPATH so an empty element can be preserved when prepending Homebrew’s Info dir.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/cmd/shellenv.sh
Comment thread Library/Homebrew/cmd/shellenv.sh

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look at the copilot comments.

@jdelStrother

Copy link
Copy Markdown
Contributor Author

The comments didn't seem correct to me at first glance, but I'm away at the moment. Will take a closer look in a week or so

@MikeMcQuaid

Copy link
Copy Markdown
Member

Passing on this. Please reopen the PR when you can be more responsive.

@jdelStrother

Copy link
Copy Markdown
Contributor Author

I responded to Copilot's comments an hour ago

@MikeMcQuaid

Copy link
Copy Markdown
Member

@jdelStrother You opened the PR two weeks ago, responded to some comments today and said you'll take a look in a week or two. This level of delay in back and forth is very inefficient for everyone involved, sorry.

@jdelStrother

Copy link
Copy Markdown
Contributor Author

Sorry, I didn't realize it was necessary to reply to Copilot - I assumed a maintainer would say "yes I agree with the LLM, do this", or "no, this LLM is garbage, ignore it".

I was available for 7 days after I initially posted, then went out of the country for 7 days, during which time you asked me to take a look at the Copilot comments. I'm now back and can be more responsive.

@MikeMcQuaid MikeMcQuaid reopened this Jul 28, 2026
@MikeMcQuaid

Copy link
Copy Markdown
Member

@jdelStrother Ok, let's try this again.

Please explain here with step-by-step instructions on how to reliably reproduce the bug and what the alternatives you've considered are to this PR's approach.

One of the Copilot reviews can be ignored but the other is worth verifying.

@jdelStrother

Copy link
Copy Markdown
Contributor Author

Please explain here with step-by-step instructions on how to reliably reproduce the bug

Launch emacs -nw, inspect the variable Info-directory-list. Here's what it looks like for me with different INFOPATH settings:

set --global --export INFOPATH /opt/homebrew/share/info (the current behaviour with homebrew's shellenv)

("/Users/jon/.config/emacs/.local/straight/build-31.0.90/compat"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/orderless"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/embark"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/evil"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/flymake"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/editorconfig"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/eglot"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/forge"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/ghub"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/org"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/dash"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit-section"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/plz"
 "/opt/homebrew/share/info")

(note that it's got info paths from straight packages and homebrew, but is missing emacs own built-in info paths)


set --erase INFOPATH (behaviour without homebrew's shellenv, if you've not customized it)

("/Users/jon/.config/emacs/.local/straight/build-31.0.90/compat"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/orderless"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/embark"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/evil"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/flymake"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/editorconfig"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/eglot"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/forge"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/ghub"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/org"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/dash"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit-section"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/plz"
 "/nix/store/nd2j043wsvxxr95xybj8mf1icyb6i3pj-emacs-unstable-with-packages-31.0.90/share/info/"
 "/nix/store/mbyj60iy548ddc12il1kl23ssqmv4gv3-emacs-unstable-31.0.90/share/info/")

(now it has info paths from both packages and emacs built-in paths)


set --global --export INFOPATH /opt/homebrew/share/info '' (the new shellenv behaviour with this PR)

("/Users/jon/.config/emacs/.local/straight/build-31.0.90/compat"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/orderless"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/embark"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/evil"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/flymake"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/editorconfig"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/eglot"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/forge"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/ghub"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/org"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/dash"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/magit-section"
 "/Users/jon/.config/emacs/.local/straight/build-31.0.90/plz"
 "/opt/homebrew/share/info"
 "/nix/store/nd2j043wsvxxr95xybj8mf1icyb6i3pj-emacs-unstable-with-packages-31.0.90/share/info/"
 "/nix/store/mbyj60iy548ddc12il1kl23ssqmv4gv3-emacs-unstable-31.0.90/share/info/")

(now it has info paths from packages, emacs built-in paths, AND homebrew)


what the alternatives you've considered are to this PR's approach.

Ehh, nothing great. I'm currently working around by nuking homebrew's bad INFOPATH in my own dotfiles:

/opt/homebrew/bin/brew shellenv | source
set --erase INFOPATH

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining! Let's give this a go.

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Jul 28, 2026
Merged via the queue into Homebrew:main with commit 60cc972 Jul 28, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants