From 7dd0fdeda6c9a0d2426e88c221d6ad37561dd83f Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Fri, 16 Aug 2024 13:19:48 -0500 Subject: filters: send real COLUMNS and LINES values Previously filters received default COLUMNS LINES values no matter the width of the terminal. Fixes: https://todo.sr.ht/~rjarry/aerc/232 Changelog-added: Filters will receive the actual COLUMNS and LINES values. Signed-off-by: Tristan Partin Acked-by: Robin Jarry --- app/msgviewer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/msgviewer.go b/app/msgviewer.go index a78daa3a..8760bf74 100644 --- a/app/msgviewer.go +++ b/app/msgviewer.go @@ -556,6 +556,10 @@ func NewPartViewer( if term != nil { term.OnStart = func() { + if term.ctx != nil { + filter.Env = append(filter.Env, fmt.Sprintf("COLUMNS=%d", term.ctx.Window().Width)) + filter.Env = append(filter.Env, fmt.Sprintf("LINES=%d", term.ctx.Window().Height)) + } pv.attemptCopy() } } -- cgit