-
Notifications
You must be signed in to change notification settings - Fork 2.1k
macOS without Xcode: fish_prompt spams install prompt dialogs #9343
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
Comments
There is a related issue, that I can't find right now. Possibly, I only ever spoke to @zanchey about it personally. After edit: just reboots. Because TMPDIR is cleared and the cache is stored at |
The issue was #6625, and it was apparently closed by mistake. |
Move logic from previous two commits into fish_git_function itself, and add a check for xcode-select --print-path failing. This indicates it cannot find a developer dir for xcode or the command line tools. Return 1 just as if `command -sq git` failed. Fixes fish-shell#9343
git on macOS has two hazards: 1. It comes "preinstalled" as a stub which pops a dialog to install command line developer tools. 2. It may populate the xcrun cache when run for the first time, which may take several seconds. We fix these as follows, both fixes limited to Darwin: 1. If git is `/usr/bin/git` and `xcode-select --print-path` fails, then do not run git automatically. 2. Second, if there is no file at `xcrun --show-cache-path`, we take it as an indication that the cache is not yet populated. In this case we run `git` in the background to populate the cache. Fixes fish-shell#9343
git on macOS has two hazards: 1. It comes "preinstalled" as a stub which pops a dialog to install command line developer tools. 2. It may populate the xcrun cache when run for the first time, which may take several seconds. We fix these as follows, both fixes limited to Darwin: 1. If git is `/usr/bin/git` and `xcode-select --print-path` fails, then do not run git automatically. 2. Second, if there is no file at `xcrun --show-cache-path`, we take it as an indication that the cache is not yet populated. In this case we run `git` in the background to populate the cache. Credit to @floam for the idea. Fixes fish-shell#9343. Fixes fish-shell#6625.
git on macOS has two hazards: 1. It comes "preinstalled" as a stub which pops a dialog to install command line developer tools. 2. It may populate the xcrun cache when run for the first time, which may take several seconds. We fix these as follows, both fixes limited to Darwin: 1. If git is `/usr/bin/git` and `xcode-select --print-path` fails, then do not run git automatically. 2. Second, if there is no file at `xcrun --show-cache-path`, we take it as an indication that the cache is not yet populated. In this case we run `git` in the background to populate the cache. Credit to @floam for the idea. Fixes fish-shell#9343. Fixes fish-shell#6625.
git on macOS has two hazards: 1. It comes "preinstalled" as a stub which pops a dialog to install command line developer tools. 2. It may populate the xcrun cache when run for the first time, which may take several seconds. We fix these as follows, both fixes limited to Darwin: 1. If git is `/usr/bin/git` and `xcode-select --print-path` fails, then do not run git automatically. 2. Second, if there is no file at `xcrun --show-cache-path`, we take it as an indication that the cache is not yet populated. In this case we run `git` in the background to populate the cache. Credit to @floam for the idea. Fixes #9343. Fixes #6625.
On macOS,
/usr/bin/git
exists even ifgit
might not be installed - it is a tiny libxcselect.dylib wrapper that basically runsxcrun git
which findsgit
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 runninggit
prints an error in this situation:… and pops up a modal dialog:

Since we try
git
infish_git_prompt
whichfish_prompt
tries by default, as long ascommand -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 ifcommand git
is /usr/bin/git on Darwin.edit: or find a trick to suppress the dialog.
The text was updated successfully, but these errors were encountered: