From 49bdace2f62c524980229329fbae35be6b2a0908 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 7 Nov 2022 02:01:21 +0100 Subject: [PATCH] .seek(0) on the message before passing stdin to the markup process --- widgets/compose.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widgets/compose.go b/widgets/compose.go index 245bd40..0966275 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -541,6 +541,12 @@ func (c *Composer) GenerateMarkup(markupKey string) error { } go func() { defer stdin.Close() + _, err := c.email.Seek(0, io.SeekStart) + if err != nil { + logging.Warnf("failed to seek beginning of mail: %v", err) + return + } + io.Copy(stdin, c.email) }() outBytes, err := proc.Output()