user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Kyle Meyer <kyle@kyleam.com>
Cc: meta@public-inbox.org
Subject: [PATCH] script/lei: waitpid for git-credential and pager
Date: Mon, 5 Apr 2021 08:36:57 +0000	[thread overview]
Message-ID: <20210405083657.GA25805@dcvr> (raw)
In-Reply-To: <87k0ph8ivs.fsf@kyleam.com>

Kyle Meyer <kyle@kyleam.com> 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 {

  reply	other threads:[~2021-04-05  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  9:42 [PATCH] lei: fix git-credential handling Eric Wong
2021-04-05  4:17 ` Kyle Meyer
2021-04-05  8:36   ` Eric Wong [this message]
2021-04-05  8:59     ` [RFC] script/lei: don't setsid on MUA spawn Eric Wong
2021-04-05 21:26     ` [PATCH] script/lei: waitpid for git-credential and pager Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210405083657.GA25805@dcvr \
    --to=e@80x24.org \
    --cc=kyle@kyleam.com \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).