From 583252a0d8e24e90806f0b837a8b385f7f98ba29 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 58b9c8d06..5e9c46cc6 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