Skip to content

[Brew] Installing apps with custom Homebrew cask directory fails #25112

Closed

Description

@brycedriesenga

Extension

https://www.raycast.com/nhojb/brew

Raycast Version

1.104.4

OS Version

Sonoma 14.5

Description

Installation using brew install works in Terminal, but trying to install with the extension, the install just seems to hang indefinitely. Perhaps because I lack admin permissions to install to /Applications on my work Mac?

Steps To Reproduce

  1. Set custom Homebrew cask installation folder (e.g. ~/Applications) with no admin permissions for /Applications.
  2. Attempt to install a cask using the extension.

Current Behaviour

No response

Expected Behaviour

No response

Activity

  1. added
    bug
    extension
    on Feb 3, 2026
  2. raycastbot commented on Feb 3, 2026

    @raycastbot
    Collaborator

    Thank you for opening this issue!

    🔔 @nhojb @Aayush9029 @mathieudutour @urwrstkn8mare @ashokbaruaakas @MillerApps @pernielsentikaer @jfkisafk @vpukhanov @j3lte @alexander-cato @ViGeng @ridemountainpig @chrismessina you might want to have a look.

    💡 Author and Contributors commands

    The author and contributors of nhojb/brew can trigger bot actions by commenting:

    • @raycastbot close this issue Closes the issue.
    • @raycastbot close as not planned Closes the issue as not planned.
    • @raycastbot close as duplicate Closes the issue as duplicate.
    • @raycastbot rename this issue to "Awesome new title" Renames the issue.
    • @raycastbot reopen this issue Reopens the issue.
    • @raycastbot assign me Assigns yourself to the issue.
    • @raycastbot good first issue Adds the "Good first issue" label to the issue.
    • @raycastbot keep this issue open Make sure the issue won't go stale and will be kept open by the bot.
  3. added
    extension: brew
    on Feb 3, 2026
  4. dibas-np commented on Nov 4, 2026

    @dibas-np
    Contributor

    I'd like to pick this up. I reproduced what I think is happening, and have two questions to confirm it.

    The extension runs brew with Raycast's environment, not your shell's. Raycast's environment has no HOMEBREW_* variables, so a HOMEBREW_CASK_OPTS="--appdir=~/Applications" set in ~/.zshrc reaches brew in Terminal but not the extension's brew, which installs to /Applications instead.

    When brew can't write to the install folder, it copies the app with sudo -A. That calls the extension's askpass script, which opens a "brew: Enter login password" dialog, and the install waits for it. To check this, I set the install folder to one I can't write to and ran brew install --cask keycastr the way the extension does. brew asked for a password three times, then failed with sudo: 3 incorrect password attempts. Without admin rights, no password works, and if the dialog is behind another window, the install looks stuck.

    @brycedriesenga, could you tell me:

    1. Where is your install folder set? In HOMEBREW_CASK_OPTS in a shell file, or somewhere else?
    2. When the install hangs, is there a password dialog open, maybe behind other windows?

    Until there's a fix, a workaround is to set the option in ~/.homebrew/brew.env, which brew reads however it's started:

    mkdir -p ~/.homebrew
    echo 'HOMEBREW_CASK_OPTS=--appdir=~/Applications' >> ~/.homebrew/brew.env

    For the fix, I'm thinking of making the install fail with a clear message instead of hanging, and possibly adding an install folder preference. @nhojb, would you take a preference for that, or would you rather point users to brew.env?

  5. nhojb commented on Nov 4, 2026

    @nhojb
    Contributor

    @nhojb, would you take a preference for that, or would you rather point users to brew.env?

    Probably best to point users to brew.env - otherwise we end up with two sources of truth.
    We could add a note to the README and possibly a note in the extension's settings. Can't remember if that is supported or not.

  6. added a commit that references this issue on Nov 5, 2026
    a9a7c9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextensionextension: brew

    Type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions