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 shellenv outputs nothing [no brew env vars exist] #943

Closed
3 tasks done
ArtS opened this issue Feb 21, 2025 · 1 comment
Closed
3 tasks done

brew shellenv outputs nothing [no brew env vars exist] #943

ArtS opened this issue Feb 21, 2025 · 1 comment

Comments

@ArtS
Copy link

ArtS commented Feb 21, 2025

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • your problem was from running the official install or uninstall script?
  • you carefully read the output and it was not a git fetch or other connection issue to GitHub (that Homebrew has no control over)?
  • after installation: ran brew config and brew doctor and included their output with your issue? If you couldn't install: provided your OS version with the output of your issue?
❯ brew config
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:d9faa506c014dedc0b034a68103ba75c9a58242f4d6c67b6ca0f649c39602bcf
######################################################################### 100.0%
==> Pouring portable-ruby-3.3.7.arm64_big_sur.bottle.tar.gz
HOMEBREW_VERSION: 4.4.21
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2e57f8f794af60804dcc185d1807c6d6ca10418c
Last commit: 4 days ago
Branch: master
Core tap JSON: 17 Feb 09:42 UTC
Core cask tap JSON: 17 Feb 09:42 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BROWSER: open
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nano
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: 16-core 64-bit arm_brava
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3.1-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: N/A
Rosetta 2: false
❯ brew doctor
Your system is ready to brew.

What you were trying to do (and why)

Trying to set up brew-specific shell completion, as per https://docs.brew.sh/Shell-Completion

What happened (include command output)

When running brew shellenv to see which variables Brew tries to set, there is no output. Brew env vars are not set either (output of env)

Command output

❯ brew shellenv
~ ❯

❯ env
TERM_SESSION_ID=
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Listeners
LC_TERMINAL_VERSION=3.5.11
COLORFGBG=15;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
LANG=en_AU.UTF-8
PWD=/Users/
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
TERM_FEATURES=
TERM_PROGRAM_VERSION=3.5.11
TERM_PROGRAM=iTerm.app
PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/iTerm.app/Contents/Resources/utilities
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
TERMINFO_DIRS=/Applications/iTerm.app/Contents/Resources/terminfo:/usr/share/terminfo
HOME=/Users/
TMPDIR=/var/folders/1m/l6lq30gs1fnbk72hpklw7lf00000gn/T/
USER=
XPC_SERVICE_NAME=0
LOGNAME=
ITERM_SESSION_ID=w0t0p0:
__CF_USER_TEXT_ENCODING=0x0:0:15
SHLVL=1
OLDPWD=/Users/
BROWSER=open
EDITOR=nano
VISUAL=nano
PAGER=less
LESS=-g -i -M -R -S -w -X -z-4
P9K_TTY=old
_P9K_TTY=/dev/ttys000
LESS_TERMCAP_mb=
LESS_TERMCAP_md=
LESS_TERMCAP_me=
LESS_TERMCAP_se=
LESS_TERMCAP_so=
LESS_TERMCAP_ue=
LESS_TERMCAP_us=
LSCOLORS=exfxcxdxbxGxDxabagacad
GREP_COLOR=37;45
GREP_COLORS=mt=37;45
P9K_SSH=0
_P9K_SSH_TTY=/dev/ttys000
_=/usr/bin/env

What you expected to happen

Brew to print out env vars it is intending to set

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

  1. Install brew as per official instructions
  2. brew shellenv
@Bo98
Copy link
Member

Bo98 commented Feb 21, 2025

brew shellenv won't output anything if your PATH is already configured to contain the Homebrew directories, which it seems to be from your output.

The reason for this is to avoid repeatedly adding the same directories to the PATH if it gets rerun.

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2025
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

No branches or pull requests

3 participants