From 0b5618c45267b005d0732aac6ee610ca95d30550 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sat, 8 Apr 2017 14:21:15 -0700 Subject: [PATCH] Ensure mutt stays in endwin during calls to pipe_msg() (closes #3929) The previous commit solved the problem reported in #3929: progressbar output while downloading a message via IMAP was refreshing the mutt ncurses session after launching the pipe program. To ensure another place in the code doesn't inadvertantly generate output, wrap OPTKEEPQUIET around the calls to pipe_msg()/mutt_wait_filter() too. --- commands.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands.c b/commands.c index 58b9c8d0..5e9c46cc 100644 --- a/commands.c +++ b/commands.c @@ -406,10 +406,12 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, mutt_perror _("Can't create filter process"); return 1; } - + + set_option (OPTKEEPQUIET); pipe_msg (h, fpout, decode, print); safe_fclose (&fpout); rc = mutt_wait_filter (thepid); + unset_option (OPTKEEPQUIET); } else { /* handle tagged messages */ @@ -440,12 +442,14 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, mutt_perror _("Can't create filter process"); return 1; } + set_option (OPTKEEPQUIET); pipe_msg (Context->hdrs[Context->v2r[i]], fpout, decode, print); /* add the message separator */ if (sep) fputs (sep, fpout); safe_fclose (&fpout); if (mutt_wait_filter (thepid) != 0) rc = 1; + unset_option (OPTKEEPQUIET); } } } @@ -457,6 +461,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, mutt_perror _("Can't create filter process"); return 1; } + set_option (OPTKEEPQUIET); for (i = 0; i < Context->vcount; i++) { if (Context->hdrs[Context->v2r[i]]->tagged) @@ -470,6 +475,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, safe_fclose (&fpout); if (mutt_wait_filter (thepid) != 0) rc = 1; + unset_option (OPTKEEPQUIET); } } -- 2.40.0