Files opened in Atom won't refresh if changed externally


#1

I’ve been very happily using Atom for a couple months now, and one thing I like is that it sees that a file is changed by an external program. For example: you run code on a text file you have open in Atom, it will detect that happened, and refresh to view the new content. I’ve been using Atom on Fedora 26 KDE and Fedora 27 GNOME with no issue. Well, I upgraded my Fedora 26 KDE box to Fedora 27 GNOME, and copied over all the old Atom config files that I had from my backup. But now, Atom will no longer see any file changes in open projects. If a file changes, I have to close the tab it’s in and reopen it. If I create a new file in my project externally, I have to close Atom entirely to make it see the new file. What can I do to restore this functionality?


#2

Shot in the dark: how did you install Atom when you upgraded?


#3

The same way I did on my other boxes. I used Fedy which has an option to grab and install Atom


#4

I decided to follow suit with your thought and grabbed the RPM from atom.io and installed it that way. Still no luck. Could my configs from my last install be causing incompatibility issues? It’s not far off from vanilla except a couple addons that aren’t a big deal to fetch, just would rather not lose my sessions


#5

You can check by starting Atom from the command line with atom --safe, or to completely reset Atom you can use mv ~/.atom ~/.atom-backup and restart the editor.


#6

Aha yup. There’s something in the ~/.atom folder causing a muck


#7

Now I would cp ~/.atom-backup/packages ~/.atom and check again. Whether or not it works will eliminate a lot of possibilities. If it fails again, then the culprit is a package and you have to try disabling them one at a time. If it keeps working, then you should copy just config.cson and check again. Keep copying one item at a time until you see the bug appear or everything is relocated.


#8

Spoke too soon. Seemed to work on a couple files but not anymore. Everything is 100% vanilla right now


#9

Did it seem to work on a couple of files or did it actually work on a couple of files before it stopped working? Are they the same files? Did anything happen between it working and it not working? Did you edit the files inside Atom at all?


#10

I tested 2 files and it did in fact work. I would leave the file open in Atom, edit the file in Gedit and it would appear in Atom immediately after the save. I know they’re the same files because I would click “show in folder” in Atom and then open the file from there in Gedit. The only differentiating factor between it working and not working is the new OS install. But again, my laptop has a near virtually identical setup (same OS, same desktop, same way of fetching Atom, same filesystems). If I edit the files in Atom, they will appear in my other applications. And closing the tab the file is in and reopening the file in Atom will display the changes


#11

To be frank, I have no answer to what was causing this issue. But what I did was take the ~/.atom and ~/.config/Atom contents from my known working setup and copy them over. The projects that were open on my laptop already and appeared open on my desktop had the expected and desirable behavior. But then when I went to open an old file that wasn’t presently open in Atom before, the unwanted behavior would return only for that file. So it appears that any file or folder opened on this system will not sync data properly, but projects that were opened on the other machine will? Doesn’t make much sense


#12

That’s pretty weird.


#13

Indeed. Are there some accessible debugging tools for Atom, see if I can get some sort of output? I also wonder if this quirkiness is hardware related. If these setups are identical, idk what else it could be.


#14

Atom includes the Chrome developer tools, but I don’t know how one would monitor the file-watching component short of going into the source and plugging in a bunch of console.logs. My familiarity with Atom’s code doesn’t go anywhere near that deep.


#15

And I know my coding in general doesn’t go that far :grin: perhaps this could be an issue for their github?


#16

Yes. I think you can give enough information to make a well-written issue and perhaps one of the developers will have an idea.