about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-07 23:05:11 -1000
committerEric Wong <e@80x24.org>2021-02-08 22:07:42 +0000
commit80ba871c557eb5ba79c73150519ce9ea5225d695 (patch)
tree891a8b05bb0338d0afdb07b5eae72bb2d6285b6e /script
parentc642cbd0b4e490d5c0922f0659129c936e5349c8 (diff)
downloadpublic-inbox-80ba871c557eb5ba79c73150519ce9ea5225d695.tar.gz
While using utime on the destination Maildir is enough for mutt
to eventually notice new mail, "eventually" isn't good enough.

Send a SIGWINCH to wake mutt (and likely other MUAs)
immediately.  This is more portable than relying on MUAs to
support inotify or EVFILT_VNODE.
Diffstat (limited to 'script')
-rwxr-xr-xscript/lei8
1 files changed, 5 insertions, 3 deletions
diff --git a/script/lei b/script/lei
index b7f21f14..0b0e2976 100755
--- a/script/lei
+++ b/script/lei
@@ -105,13 +105,15 @@ Falling back to (slow) one-shot mode
                         die "recvmsg: $!";
                 }
                 last if $buf eq '';
-                if ($buf =~ /\Ax_it ([0-9]+)\z/) {
+                if ($buf =~ /\Aexec (.+)\z/) {
+                        $exec_cmd->(\@fds, split(/\0/, $1));
+                } elsif ($buf eq '-WINCH') {
+                        kill($buf, $$); # for MUA
+                } elsif ($buf =~ /\Ax_it ([0-9]+)\z/) {
                         $x_it_code = $1 + 0;
                         last;
                 } elsif ($buf =~ /\Achild_error ([0-9]+)\z/) {
                         $x_it_code = $1 + 0;
-                } elsif ($buf =~ /\Aexec (.+)\z/) {
-                        $exec_cmd->(\@fds, split(/\0/, $1));
                 } else {
                         $sigchld->();
                         die $buf;