about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiQuery.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-10 12:15:17 +0000
committerEric Wong <e@80x24.org>2021-01-12 03:51:43 +0000
commit7b79c918a5ea79f6adc380ca917b0353475ab29c (patch)
tree7f471a1810986a8ad3b47fccb7fa5dd2d95666e0 /lib/PublicInbox/LeiQuery.pm
parentf478afc01d2137baa215b112f7cbd33c29f28ab7 (diff)
downloadpublic-inbox-7b79c918a5ea79f6adc380ca917b0353475ab29c.tar.gz
While most single keystrokes work fine when the pager is
launched from the background daemon, Ctrl-C and WINCH can cause
strangeness when connected to the wrong terminal.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r--lib/PublicInbox/LeiQuery.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index 9a383cef..6e778785 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -125,9 +125,10 @@ sub lei_q {
         # my $wcb = PublicInbox::LeiToMail->write_cb($out, $self);
         $self->{mset_opt} = \%mset_opt;
         $lxs->do_query($self, \@srcs);
-        if ($pid_old12) {
+        if ($pid_old12) { # [ pid, stdout, stderr ]
+                my $pid = $pid_old12->[0];
                 $self->{$_} = $pid_old12->[$_] for (1, 2);
-                dwaitpid($pid_old12->[0], undef, $self->{sock});
+                dwaitpid($pid, undef, $self->{sock}) if $pid;
         }
 }