Why Does Installing The Command Line Tools Change My Icons and How Can I Fix This?

This is something I have struggled with for years, that no one seems to understand. So If I have an application like Sublime Text installed, then all of my Javascript, Ruby, PHP, etc files will use the default icons in the Sublime Text Resources folder as long as Sublime Text is set as the default application to open these files. Once I install xcode and the command line tools this changes all of those icons to generic icons that look like a blank piece of paper with the file type written at the bottom. So for example a ruby file goes from looking like https://imgur.com/a/m2HHq to looking like https://imgur.com/a/KLWoP even though Sublime Text is still set as the default application to open this file. The correct icon even shows in the Get Info window of the file as shown here https://imgur.com/a/obYQp

I am struggling with a method on how to fix this issue. I want these icons to appear as the icons set by the application set to open these files by default. I thought these generic page icons might be stored in the resources folder of xcode but they are not. They also do not show up in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ but they are not located there either. Can anyone help me with this issue? I do not want my javascript and ruby and php, etc icons to show up as these generic page icons with the file type written at the bottom of it. I would like these icons to show up as the icon set to open these files by default.

Replies

I'm not sure you can control this. Basically, you have two applications that have both registered an icon for the same file type, identified only by an extension. So when launch services goes to determine the icon for the document, which one is supposed to choose?


Maybe launch services has some logic for resolving this, or maybe it's the just the last app to get registered for that type. But the bottom line is that there's no explicit or implicit information in the file that tells launch services which of the two applications it "belongs" to.


And apparently it doesn't matter what the default app for that document is. If you think that should be a factor in determing its icon, file a bug report, although I can think of a couple of reasons why you wouldn't want the framework to do that.