From 80ba871c557eb5ba79c73150519ce9ea5225d695 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Feb 2021 23:05:11 -1000 Subject: lei q: SIGWINCH process group with the terminal 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. --- script/lei | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'script/lei') 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; -- cgit v1.2.3-24-ge0c7