summarylogtreecommitdiffstats
path: root/fix-exit-regression.patch
blob: eeaf3afba227a1ca1c82eda224d9b18a1907a373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 21514e6d4f38cdf4d5ce9186c2dcc8e6bb63ce15 Mon Sep 17 00:00:00 2001
From: Felipe Contreras <felipe.contreras@gmail.com>
Date: Sun, 6 Dec 2020 04:01:03 -0600
Subject: [PATCH] Fix exit regression

Any time you start a job in the background vte gets confused and waits
several seconds for nothing to happen before exiting.

This regression was thanks to commit 7888602c
(lib: Rework child exit and EOF handling, 2019-11-17).

It can be triggered by simply doing:

  sleep infinity &
  exit

The maintainers of vte clearly have no intention fixing the issue that
was reported more than one year ago.

  https://gitlab.gnome.org/GNOME/vte/-/issues/204

With this patch we can return to the behavior of 0.59, where the
terminal exits immediately.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 src/vte.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vte.cc b/src/vte.cc
index 2614e5b4..ea80d1ee 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -3130,6 +3130,9 @@ Terminal::child_watch_done(pid_t pid,
 
         m_pty_pid = -1;
 
+        if (pty())
+                unset_pty();
+
         /* If we still have a PTY, or data to process, defer emitting the signals
          * until we have EOF on the PTY, so that we can process all pending data.
          */
-- 
2.29.2