Github messages for mblaze
 help / color / mirror / Atom feed
From: Parasrah <Parasrah@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mrep: fix subject not populating when pager stdout is not tty
Date: Mon, 17 Jul 2023 06:41:47 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-243@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

There is a new pull request by Parasrah against master on the mblaze repository

https://github.com/Parasrah/mblaze master
https://github.com/leahneukirchen/mblaze/pull/243

mrep: fix subject not populating when pager stdout is not tty
If the pager is set to something where stdout is not a TTY, such as a text editor, it causes non-interactive calls to `mscan` to fail with the error: `Fatal error: stdout is not a tty`. When building the subject, `mrep` fetches the subject from the email being replied to using `mscan`, causing this error to manifest and the subject line to end up as: "Re: ". Explicitly setting the pager to `cat` when fetching the email subject in `mrep` prevents this error.

A patch file from https://github.com/leahneukirchen/mblaze/pull/243.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-243.patch --]
[-- Type: text/x-diff, Size: 1256 bytes --]

From 0279b94f0e13ff40a633559e39c1ba5355abe812 Mon Sep 17 00:00:00 2001
From: parasrah <dev@parasrah.com>
Date: Sun, 16 Jul 2023 22:35:05 -0600
Subject: [PATCH] mrep: fix subject not populating when pager stdout is not tty

If the pager is set to something where stdout is not a TTY, such as a
text editor, it causes non-interactive calls to mscan to fail with the
error: `Fatal error: stdout is not a tty`. When building the subject,
`mrep` fetches the subject from the email being replied to using
`mscan`, causing this error to manifest and the subject line to end up
as: "Re: ". Explicitly setting the pager to `cat` when fetching the
email subject in `mrep` prevents this error.
---
 mcom | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mcom b/mcom
index 4e834c6..90c7a56 100755
--- a/mcom
+++ b/mcom
@@ -373,7 +373,7 @@ fi
 			printf '%s\n' "$hdrs" | awk '{ print }' |
 				msed "/body/d" -
 		fi | sed '/^$/d'
-		printf 'Subject: Re: %s\n' "$(COLUMNS=10000 mscan -f '%S' "$1")"
+		printf 'Subject: Re: %s\n' "$(MBLAZE_PAGER=cat COLUMNS=10000 mscan -f '%S' "$1")"
 		if ! printf '%s\n' "$hdrs" | awk '{ print }' |
 		     mhdr -h from: - >/dev/null; then
 			addr=$(maddr -a -h delivered-to:to:cc:bcc: "$1" | replyfrom | head -n1)

             reply	other threads:[~2023-07-17  4:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  4:41 Parasrah [this message]
2023-07-17 13:33 ` leahneukirchen
2023-07-18  4:11 ` Parasrah
2023-07-18 12:05 ` [PR PATCH] [Closed]: " leahneukirchen
2023-07-18 12:05 ` leahneukirchen

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

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

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-243@inbox.vuxu.org \
    --to=parasrah@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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.
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 NNTP newsgroup(s).