about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index c3645698..e95a674b 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -746,6 +746,17 @@ sub start_mua {
         }
 }
 
+sub poke_mua { # forces terminal MUAs to wake up and hopefully notice new mail
+        my ($self) = @_;
+        return unless $self->{opt}->{mua} && -t $self->{1};
+        # hit the process group that started the MUA
+        if (my $s = $self->{sock}) {
+                send($s, '-WINCH', MSG_EOR);
+        } elsif ($self->{oneshot}) {
+                kill('-WINCH', $$);
+        }
+}
+
 # caller needs to "-t $self->{1}" to check if tty
 sub start_pager {
         my ($self) = @_;