aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2024-08-16 13:19:48 -0500
committerRobin Jarry <robin@jarry.cc>2024-08-20 09:30:29 +0200
commit7dd0fdeda6c9a0d2426e88c221d6ad37561dd83f (patch)
treea1c4aaa2a5e6a28c6282d825c2e565d7441abf18
parentf2ac5a7c3c6516289c5c07e85dad41d7379df771 (diff)
downloadaerc-7dd0fdeda6c9a0d2426e88c221d6ad37561dd83f.tar.gz
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 <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--app/msgviewer.go4
1 files changed, 4 insertions, 0 deletions
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()
}
}