Skip to content

macOS without Xcode: fish_prompt spams install prompt dialogs #9343

@floam

Description

@floam

On macOS, /usr/bin/git exists even if git might not be installed - it is a tiny libxcselect.dylib wrapper that basically runs xcrun git which finds git in the installed Xcode or Command Line Tools (...Developer/) path. It prompts the user to install Xcode if they don't have it, which they very well might not if they installed fish via the .pkg installer or are trying the .app bundle. I am not sure what it does if the user isn't an administrator that can't install Xcode anyhow, like if someone tries fish in a computer lab or something.

So, git exists but running git prints an error in this situation:

> git
xcode-select: note: no developer tools were found at '/Applications/Xcode.app',
requesting install. Choose an option in the dialog to download the command line
developer tools.

… and pops up a modal dialog:
Screenshot 2022-11-11 at 3 30 22 PM

Since we try git in fish_git_prompt which fish_prompt tries by default, as long as command -sq git works, this makes fish pretty unusable unless the person relents. The only positive thing I can say, is it is throttled to display no more than once per 10 seconds. It's not our fault, but it's annoying enough I'm calling it a bug.

xcrungit.mp4

The solution here is going to be gating git behind some check if the developer tools are installed if command git is /usr/bin/git on Darwin.

edit: or find a trick to suppress the dialog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intendedmacosmacOS-specific issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions