From 76002741072a61d1adcf97f708a3db9d544b27de Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 9 Nov 2022 20:38:59 +0100 Subject: filters: export more info to filter processes Export some more environment variables to the pager commands. Signed-off-by: Robin Jarry Acked-by: Koni Marti --- widgets/msgviewer.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'widgets') diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index d168f456..4006e25b 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -595,6 +595,14 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig, fmt.Sprintf("AERC_MIME_TYPE=%s", mime)) filter.Env = append(filter.Env, fmt.Sprintf("AERC_FILENAME=%s", part.FileName())) + if flowed, ok := part.Params["format"]; ok { + filter.Env = append(filter.Env, + fmt.Sprintf("AERC_FORMAT=%s", flowed)) + } + filter.Env = append(filter.Env, + fmt.Sprintf("AERC_SUBJECT=%s", info.Envelope.Subject)) + filter.Env = append(filter.Env, fmt.Sprintf("AERC_FROM=%s", + format.FormatAddresses(info.Envelope.From))) if pagerin, err = pager.StdinPipe(); err != nil { return nil, err } -- cgit