diff options
author | Robin Jarry <robin@jarry.cc> | 2022-09-15 16:39:29 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-09-15 20:50:44 +0200 |
commit | 77f69501d6483bf94e85cd8b9cb520c3d9175a54 (patch) | |
tree | bbcb19f1bf393702ea5d669938db43ed54ebf60a /widgets/msgviewer.go | |
parent | c7df28d6325bcb67e9d075192d9fa357417984e7 (diff) | |
download | aerc-77f69501d6483bf94e85cd8b9cb520c3d9175a54.tar.gz |
msgviewer: properly close embedded terminal
The terminal widget already handles most boring stuff: unwatch terminal
events, kill the underlying process, wait for it to exit, etc. Call the
Close() method and be done with it.
This avoids issues where the embedded terminal widget is destroyed but
the pager process does not know about it and dies in agony, writing over
aerc's UI:
Vim: Caught deadly signal HUP
Also, it may avoid leaving child processes as zombies without giving
them a proper burial.
Reported-by: skejg
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 94ba98c8..a74d693f 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -863,12 +863,9 @@ func (pv *PartViewer) Draw(ctx *ui.Context) { } func (pv *PartViewer) Cleanup() { - if pv.pager != nil && pv.pager.Process != nil { - err := pv.pager.Process.Kill() - if err != nil { - logging.Warnf("failed to kill pager process: %v", err) - } - pv.pager = nil + if pv.term != nil { + pv.term.Close(nil) + pv.term = nil } } |