aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/msgviewer.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-09-15 16:39:29 +0200
committerRobin Jarry <robin@jarry.cc>2022-09-15 20:50:44 +0200
commit77f69501d6483bf94e85cd8b9cb520c3d9175a54 (patch)
treebbcb19f1bf393702ea5d669938db43ed54ebf60a /widgets/msgviewer.go
parentc7df28d6325bcb67e9d075192d9fa357417984e7 (diff)
downloadaerc-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.go9
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
}
}