Watching for external edits stops in Linux

Hi all, first of all, thanks for your work on Joplin!

I use gvim to edit documents externally on linux in v 1.0.158. Unfortunately about half of the time, Joplin stops watching the file and does not see the updates from the external editor file. I have not been able to reproduce consistently, but it seems that the line

2019-05-31 13:00:51: "ExternalEditWatcher: Event: unlink: /home/zach/.config/joplin-desktop/"

is logged when this happens.

This is a big inconvenience and has caused me to lose work several times.

Should I file an issue on github?


I had the issue, but it happened consistently after about 3 saves (I don’t remember exactly). To fix this I needed to start vim like this
gvim -c 'set backupcopy=yes'
And to get that into joplin (using gnome-terminal on linux)

(Replace vim with gvim)

If this doesn’t fix your issue, you should probably open an issue on github.


Ah, just found this

I will try it

Putting it in .../ftplugin/markdown.vim or your vimrc as suggested by matthewmoppett is probably the easiest way to handle it.

Thanks @CalebJohn, that appears to have fixed it!

Maybe we should add this to the FAQ?

Yeah, it might be a good thing in the FAQ.

I think what would be more useful is to change the “Watching” button to say “Error” if an “unlink” event happens and possibly point to a place where they can find out how to fix it.

Another question is “should Joplin be able to tolerate these unlink events?” it would be nice if it just worked. Maybe chokidar has something that can handle it.

This seems like a relevant issue:, but it was closed long ago.

In any case, imo this code needs to be changed so at least the button displays an accurate status, or maybe even can recover.

There are actually quite a few problems with fsevent and chokidar. And they are being worked on upstream.

I can't say anything to that, but maybe @laurent can.

I made an issue:

Same issue with xed on Linux Mint. I was using that since it came default. I get 1 save before it stops capturing changes. It seems that the -nb (no backup) argument for xed has been depreciated (found it on a manpage somewhere online).

Anyone using gedit? Is that working?

i’m using gedit on linux debian. 1 save before it stops capturing changes! i opened the discussion here: Bug saving notes in external editor