From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F419B1F4B4; Mon, 5 Apr 2021 08:36:57 +0000 (UTC) Date: Mon, 5 Apr 2021 08:36:57 +0000 From: Eric Wong To: Kyle Meyer Cc: meta@public-inbox.org Subject: [PATCH] script/lei: waitpid for git-credential and pager Message-ID: <20210405083657.GA25805@dcvr> References: <20210402094254.89006-1-e@80x24.org> <87k0ph8ivs.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87k0ph8ivs.fsf@kyleam.com> List-Id: Kyle Meyer wrote: > This seems to break the pager functionality. For example, if I do > > lei q -I https://public-inbox.org/meta/ s:blob > > I end up in a misbehaving pager (/bin/less, on my system). Navigation > keys like 'j' and 'k' are instead passed through, and enter returns to > the prompt. Odd, I'm not getting the exact same behavior, but I noticed it's not getting reaped. Does this fix things for you? -----8<----- Subject: [PATCH] script/lei: waitpid for git-credential and pager We need to ensure we reap things we spawn. --- script/lei | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/lei b/script/lei index 78a7dab9..76217ab9 100755 --- a/script/lei +++ b/script/lei @@ -52,7 +52,11 @@ my $exec_cmd = sub { @parent = ($parent); return; # continue $recv_cmd in background } - $do_exec->() if !scalar(@$fds); # MUA reuses all FDs + if (scalar(@$fds)) { + $pids{$pid} = undef; + } else { + $do_exec->(); # MUA reuses all FDs + } }; if ($send_cmd && eval {