Skip to content

fix: avoid initializing homebrew if already initialized#19

Merged
inffy merged 1 commit intoublue-os:mainfrom
ehsanullahjan:main
Apr 21, 2026
Merged

fix: avoid initializing homebrew if already initialized#19
inffy merged 1 commit intoublue-os:mainfrom
ehsanullahjan:main

Conversation

@ehsanullahjan
Copy link
Copy Markdown

This change addresses two main issues:

  • brew is no longer duplicated in PATH
  • brew is not initialized multiple times

As described in [0], brew was being initialized multiple times on events such as:

  • source ~/.bashrc
  • omz reload
  • launching tmux

Also, the homebrew directory check is moved to the end to avoid a system I/O call unless absolutely necessary. After applying this change, hyperfine 'bash -i -c exit' shows an improvement of ~30 ms on my system.

[0] #18

This change addresses two main issues:

* brew is no longer duplicated in PATH
* brew is not initialized multiple times

As described in [0], brew was being initialized multiple times on events
such as:

* `source ~/.bashrc`
* `omz reload`
* launching tmux

Also, the homebrew directory check is moved to the end to avoid a system
I/O call unless absolutely necessary. After applying this change,
`hyperfine 'bash -i -c exit'` shows an improvement of ~30 ms on my
system.

[0] ublue-os#18
Copy link
Copy Markdown
Member

@renner0e renner0e left a comment

Choose a reason for hiding this comment

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

This seems fine to me, I could reproduce the issue and it got fixed by this. Thanks!

@inffy inffy merged commit 498094c into ublue-os:main Apr 21, 2026
3 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