guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

Changes made via vim on a docker (osx) host are not picked up by guard running in a docker container #434

Closed shyam-habarakada closed 3 years ago

shyam-habarakada commented 7 years ago

In an osx + docker developer setup where host osx directories are mapped into the docker container, guard/listen running on the container does not correctly pickup the changes made by vim running on the host. This did not appear to be an issue with other editors like atom (or just touching the file in bash). In all those other scenarios, guard picks up the change event as expected.

Looking a bit closer at the issue, this appeared to be a side effect of how the linux adapter for guard/listen works and vim defaults for backupcopy vimdoc.

Using a test file residing on a host directory mounted into the docker container and using inotifywatch to monitor events on that file as seen from within the container, I could see both vim and other editors triggering both ATTRIB and MODIFY events.

However the ATTRIB events aren't meeting [some] criteria guard has in place before the watch actions for the event is executed.

I can try to construct more concrete steps for a test, but before that, can we determine if this issue is something guard might be interested in addressing/supporting?

docker on osx seems like a popular and growing combination for development, and so better support for that scenario would be great.

-- p.s. I can easily workaround this by changing the backupcopy=yes. So this issue is about better, functional defaults.

shyam-habarakada commented 7 years ago

Reference: Related info on different editor behaviors

a2ikm commented 6 years ago

@shyam-habarakada Thank you, backupcopy=yes works for me!

ColinDKelley commented 3 years ago

This looks like a duplicate of #450 .