From 7b1c7debcb382dc15c98ff788bfdfa66b7c7f594 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:34:40 -0700 Subject: [PATCH] Fix `watch` not handling all file changes (#9990) Closes https://github.com/nushell/nushell/issues/9910 I noticed that`watch` was not catching all filesystem changes, because some are reported as `ModifyKind::Data(DataChange::Any)` and we were only handling `ModifyKind::Data(DataChange::Content)`. Easy fix. This was happening on Ubuntu 23.04, ext4. --- crates/nu-command/src/filesystem/watch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/watch.rs b/crates/nu-command/src/filesystem/watch.rs index a10db1706f..22f22c0976 100644 --- a/crates/nu-command/src/filesystem/watch.rs +++ b/crates/nu-command/src/filesystem/watch.rs @@ -251,7 +251,8 @@ impl Command for Watch { .pop() .map(|path| event_handler("Remove", path, None)) .unwrap_or(Ok(())), - EventKind::Modify(ModifyKind::Data(DataChange::Content)) => one_event + EventKind::Modify(ModifyKind::Data(DataChange::Content)) + | EventKind::Modify(ModifyKind::Data(DataChange::Any)) => one_event .paths .pop() .map(|path| event_handler("Write", path, None))