atom
atom copied to clipboard
Wrong icons and cannot open file
I am on macOS running Atom 1.33.1.
When I close the Atom window and open it later for further work (on macOS it is not closed completely) sometimes (sporadically) the file icons are not correct (files have folder icon and some folder have a "document"(?) outline icon) and these files won't open (the files with the folder icon).
Then I need to restart Atom completely and the icons appear correct – but it's annoying – it happens 10 times a day for sure.
Attached two screen with wrong and correct folder icons.
It's just random which folders have this outljne icon – it's not the folders that are "open" even when it looks like this in the screen.
![Bildschirmfoto 2019-03-12 um 11 34 25](https://user-images.githubusercontent.com/17568217/54194063-ad628980-44bb-11e9-93e8-02c1b8dd24d2.png)
![Bildschirmfoto 2019-03-12 um 11 34 47](https://user-images.githubusercontent.com/17568217/54194079-b2bfd400-44bb-11e9-9467-0c3c395339a2.png)
Hey @kevinlieser,
Could you give me a list of packages you have installed? Just copy the output of apm ls -ib
will do.
Are there any error diagnostics being logged to the devtools console when files refuse to open? This is usually indicative that an exception was thrown and uncaught while attempting to open a file tab.
I have another prob with the dev console – when I open it it crashes Atom and I need to "reload atom" but after that the Icons worked again ;-) Have no Idea why opening the dev console after launching atom crashes.
Here is the list of packages.
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Wait, it crashes? What happens when you start Atom in dev mode? (command: atom -d /path/to/project
).
This actually sounds like a problem with your Atom installation, which you should probably report upstream, not here. Note that a new Atom release was cut recently (v1.35.1), so I recommend you upgrade first.
Upgraded to 1.35.1 now and opening the dev console do not crash – I will report if the icon bug also solved "itself". Thanks!
No error messages then? Does everything work fine if you boot in regular (non-dev) mode?
Yes, at this point. But the problem only occured if I minimized Atom for a period of time and opened it to work again – so just if it was open for a longer time. I will report if any problems occur.
Got a wrong Icon again. Outline folder icon. Opened the Dev console, but crashed again. Attached a screen how it looked like when it crashed.
![Bildschirmfoto 2019-03-14 um 17 55 53](https://user-images.githubusercontent.com/17568217/54377160-e7cb5280-4684-11e9-97a7-7dab3abff144.png)
Also disabled atom-ternjs package temporarily.
Okay, this is because Atom's failing to start, indicating a serious error that's far beyond the scope of this package. You need to report this upstream.
This can affect file-icons
because if something breaks during package activation (i.e., during start-up), packages which have already started initialising will break, hard.
But the error / crash only occur if I open the dev console – just to be clear :-)
Either way, it's still bad. There's nothing in the file-icons
package that could possibly trigger a crash; it's clear that whatever you're experiencing is unrelated to this package.
Note that in the above screenshot, two of the package's icons are failing to load. This is either because
- You've installed this package to a non-standard path which isn't
~/.atom/packages/file-icons
Or,
- Something is screwing with Atom's internals at startup, which has somehow screwed up path resolution.
I can't think of what else it might possibly be.
Okay it do not find file:///Applications/Atom.app/Contents/Resources/app.asar/fonts/devicons.ttf?xqxft6
– but cannot follow the path as I cannot "open" app.asar.
But this problem also appears direct after launching atom and open the dev console directly (which do not crash).
Okay, have to put an issue on atom issue tracker.
…`devicons.ttf?xqxft6
Why does this URL end with a query string?
but cannot follow the path as I cannot "open" app.asar.
Just for the record, you can unpack it using asar
. It's like Atom's own version of a .tar
file.
I just started seeing this after the most recent update to file-icons (2.1.35). I'm running Atom 1.40.1 on Windows 10 and I'm seeing the same issues reported originally: file icons change sporadically when opening/closing certain directory sub-trees, file icons appear for directories, directory icons appear for files, etc.
@kaiyoma Okay, that's bad. Is there anything unusual about the filesystem in which the affected files reside? E.g., is it a remote drive (like a network file-share)? Are you using WSL?
Also, could you provide a list of packages you have installed? Run apm list --bare --installed
in your terminal and copy+paste the output.
Nothing unusual about the filesystem: it's a local clone of a git repo on my hard drive (NTFS). Not using WSL; I use the bash shell that comes with git for Windows.
The problem seems to affect only really specific files/directories in the tree. There's one file in particular that I can always go to which will trigger this problem.
$ apm list --bare --installed
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Here's a small video showing the issue: https://imgur.com/a/8keVLuf
When the video starts, you can see that collection.js
has the wrong icon (it has the TypeScript icon). When I open that file, the icon fixes itself, but the icon for case.ts
also changes... to the wrong icon! Now it's showing the JavaScript icon, even though it's a TypeScript (.ts
) file. After closing both files, I can repro the problem over and over.
Still seeing issues. Any word on this? Found a new example today:
The first styles.less
is mis-classified as a directory and doesn't open correctly. The second styles.less
is just fine. If I disable the plugin, then both files open as normal.
@kaiyoma After clicking the "folder" which fails to open, do you see any error messages being displayed in the dev-console?
@kaiyoma After clicking the "folder" which fails to open, do you see any error messages being displayed in the dev-console?
No, I don't see any warnings or errors. Admittedly, the behavior seems to change slightly every time I open Atom. Now the files are opening, but the file icons randomly change between correct and incorrect.
I just saw this behavior today while trying to open a file from the Find File (Ctrl + P) widget, not from double-clicking the entry in the sidebar. Again, the file was mis-identified as a directory and so the open process wasn't as smooth as it normally is.
I've had to disable this plugin because it's just too buggy. It's too bad, because I really like the icons, but this bug is way too disruptive to my workflow. If this issue gets fixed, I'll start using this plugin again.
@kaiyoma Try disabling the package's modeline, hashbang, and .gitattributes
strategies. This will stop file-icons
from making any filesystem calls, which are most likely the catalyst. If this doesn't fix your issue, then I'd suspect there's interference from another package.
@kaiyoma Try disabling the package's modeline, hashbang, and
.gitattributes
strategies. This will stopfile-icons
from making any filesystem calls, which are most likely the catalyst. If this doesn't fix your issue, then I'd suspect there's interference from another package.
Forgive my ignorance, but how do I do that? Happy to help out here.
Settings → Packages → Search for file-icons
→ Scroll down to Match strategies
Settings → Packages → Search for
file-icons
→ Scroll down to Match strategies
Great, thanks. Disabled those settings and will rock this for a while and report back.
Settings → Packages → Search for
file-icons
→ Scroll down to Match strategiesGreat, thanks. Disabled those settings and will rock this for a while and report back.
I haven't noticed this issue since changing these settings. 👍
I haven't noticed this issue since changing these settings. 👍
Evidently I spoke just a bit too soon. I'm now seeing this problem again in a new project and I haven't changed any settings. Back to square one. 😢
Here's another example of this issue:
In the upper highlighted area, package.json
and README.md
are picking up the icon from rollup.config.js
for some reason. However, in the next directory down (the lower highlighted area), everything is fine.
Found another one today: https://imgur.com/yGhx8z9
Initially, a directory has the wrong icon. When I click on it, the icon changes to the JSON icon, presumably because both files in the directory are JSON files.
Anything I can do to help out or gather more information? Problems like this are a bit infuriating, especially since there really isn't any other comparable icon package I can switch to.
hey, the problem still exists when the working dir has multiple child dirs.
@nszaaa3 Are you running any background tasks, like formatting with Prettier or something? If so, this might be caused by the issue @utkarshgupta137 brought up in #693.
I'll prepare a fix, but I've no way of predicting if it'll solve the issue or not. Fingers crossed. 🤞