From fb6aa4da304125a3fb7932e1335be85ff260e031 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Feb 2021 23:05:12 -1000 Subject: lei q: support --alert=CMD for early MUA users For --mua users writing to lock-free -o MFOLDER destinations; we'll keep -WINCH and send an ASCII terminal bell when results are complete. This is intended to let early MUA spawners know when lei2mail is done writing results. We'll also support running arbitrary commands. It may be used to run play(1) (from SoX), handle pipelines+redirects (e.g. "/bin/sh -c 'echo search done | wall'") or other commands. --- lib/PublicInbox/LeiOverview.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiOverview.pm') diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index f0ac4684..98c89d12 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -98,7 +98,10 @@ sub new { $opt->{'sort'} //= 'docid' if $dst ne '/dev/stdout'; $lei->{l2m} = eval { PublicInbox::LeiToMail->new($lei) }; return $lei->fail($@) if $@; - $lei->{early_mua} = 1 if $opt->{mua} && $lei->{l2m}->lock_free; + if ($opt->{mua} && $lei->{l2m}->lock_free) { + $lei->{early_mua} = 1; + $opt->{alert} //= [ '-WINCH,-bell' ] if -t $lei->{1}; + } } $self; } -- cgit v1.2.3-24-ge0c7