After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 509866 - "Close tab" button doesn't kill shell.
"Close tab" button doesn't kill shell.
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
2.24.x
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 515742 570788 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-01-16 11:01 UTC by sangu
Modified: 2014-01-20 23:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch to fix killing of shell when tab is closed (571 bytes, patch)
2008-08-01 11:17 UTC, Arun Raghavan
reviewed Details | Review
Patch to fix killing of shell when tab is closed (including with the button) (1.06 KB, patch)
2008-08-01 12:43 UTC, Arun Raghavan
reviewed Details | Review

Description sangu 2008-01-16 11:01:44 UTC
Please describe the problem:
"Close tab" button doesn't kill shell. 
Then closing tab with exit command, shell is killed.


Steps to reproduce:
1. launch gnome-terminal
2. $who (in gnome-terminal)
user tty7         2008-01-16 07:53 (:0)
user pts/0        2008-01-16 07:54 (:0.0)

3. ctrl + alt + t (new tab)
$ who
user    tty7         2008-01-16 07:53 (:0)
user    pts/0        2008-01-16 07:54 (:0.0)
user    pts/1        2008-01-16 19:55 (:0.0
3. click "Close tab" button
$ who
user    tty7         2008-01-16 07:53 (:0)
user    pts/0        2008-01-16 07:54 (:0.0)
user    pts/1        2008-01-16 19:55 (:0.0


Actual results:


Expected results:


Does this happen every time?
yes, always.

Other information:
OS : Fedora development (rawhide 20080116)
gnome-terminal-2.21.5-1.fc9
vte-0.16.12-1.fc9
Comment 1 Pacho Ramos 2008-05-02 17:32:12 UTC
There are more affected people under gentoo:
http://bugs.gentoo.org/show_bug.cgi?id=219964

Thanks for fixing this
Comment 2 Christian Persch 2008-05-29 21:25:36 UTC
*** Bug 515742 has been marked as a duplicate of this bug. ***
Comment 3 Christian Persch 2008-06-16 13:21:23 UTC
Looks like vte bug 488960.
Comment 4 Andrew 2008-07-14 11:50:41 UTC
The patch from #488960 has no effect on this bug... tested on gentoo with VTE 0.16.14 and GT 2.22.3. Is the patch presented there is Solaris specific?

After a week or 2 uptime I can have a dozen or so spare bash processes cluttering up my process list.
Comment 5 Arun Raghavan 2008-08-01 11:17:09 UTC
Created attachment 115666 [details] [review]
Patch to fix killing of shell when tab is closed

Okay, I'm a n00b to the code, but from what I could see, it appears that terminal_window_add_screen() takes a gobject reference on the screen that is not released at terminal_window_remove_screen() time.

I dumped a few debug messages in the corresponding unrealize(), dispose() and finalize() methods. With the current (2.22.3) code, only unrealize() is called when a tab is closed. With the attached patch, all three get called.
Comment 6 Christian Persch 2008-08-01 11:38:37 UTC
The refcount leak is already fixed on svn trunk / 2.23.x. Is this bug reproducible there?
There won't be another 2.22.x release, so no need for this patch although it is correct.
Comment 7 Arun Raghavan 2008-08-01 11:51:26 UTC
(In reply to comment #6)
> The refcount leak is already fixed on svn trunk / 2.23.x. Is this bug
> reproducible there?
> There won't be another 2.22.x release, so no need for this patch although it is
> correct.

I currently cannot access development tree, but I am given to understand from others that this is fixed in these.

Thanks for the review. Since there isn't going to be another 2.22.x release, we'll probably need to ship this patch.
Comment 8 Arun Raghavan 2008-08-01 12:43:34 UTC
Created attachment 115676 [details] [review]
Patch to fix killing of shell when tab is closed (including with the button)

So the previous patch only fixed the bug when closing with ctr-shift-w. This patch should fix this when the close button is used.

Please comment. TIA.
Comment 9 Christian Persch 2008-08-01 16:27:22 UTC
The best fix would be to simply remove the extra g_object_ref that's adding this ref.

--

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 10 Artur Rona 2008-10-05 14:24:19 UTC
This bug is still in version 2.24... I tested the patch (id=115676) from Arun Raghavan in 2.24.0-0ubuntu1, but I've some errors with compile. Can you fix this?

Comment 11 Artur Rona 2008-10-05 14:54:05 UTC
I tested programs on gnome-terminal. As yet only tvtime is no killing when tab is close.

Reproduce:

1. Open gnome-terminal
2. Put tvtime and run it
3. Close gnome-terminal
4. tvtime isn't killed, sound from tv is still
Comment 12 Christian Persch 2008-10-14 16:22:32 UTC
This bug isn't about *other* processes started from the shell not being killed when the tab is closed; it is *only* about the shell process itself not being killed. Please confirm that the shell itself is still running after the tab was closed; otherwise this bug goes back to FIXED.
Comment 13 Maciej (Matthew) Piechotka 2008-10-14 16:39:53 UTC
At least mine was - the shell *and* processes stayed (as shell ignored KILL waiting for HUP). So if it'll go back to FIXED the bug 515742 should be reopened.
Comment 14 Andreas Moog 2009-03-23 03:17:28 UTC
Works with 2.26.0, can be set to fixed, i think.
Comment 15 Artur Rona 2009-03-23 21:40:14 UTC
Nope, this isn't fixed with tvtime - see comment #11.
Comment 16 Christian Persch 2009-03-23 21:49:31 UTC
Ari: please see comment 12.
Comment 17 Andreas Moog 2009-03-23 22:02:05 UTC
Testing with 2.26:

 andreas@andreas-desktop:~$ who
 andreas  tty7         2009-03-23 16:23 (:0)
 andreas  pts/1        2009-03-23 22:58 (:0.0)
 andreas@andreas-desktop:~$ 

Now opening 3 tabs:

 andreas@andreas-desktop:~$ who
 andreas  tty7         2009-03-23 16:23 (:0)
 andreas  pts/0        2009-03-23 22:59 (:0.0)
 andreas  pts/2        2009-03-23 22:59 (:0.0)
 andreas  pts/3        2009-03-23 22:59 (:0.0)
 andreas  pts/1        2009-03-23 22:58 (:0.0)
 andreas@andreas-desktop:~$ 

Closing the 3 opened tabs:

 andreas@andreas-desktop:~$ who
 andreas  tty7         2009-03-23 16:23 (:0)
 andreas  pts/1        2009-03-23 22:58 (:0.0)
 andreas@andreas-desktop:~$ 

Closing confirmed by ps:

 andreas@andreas-desktop:~$ ps aux | grep bash
 andreas  28102  0.1  0.3   6380  3640 pts/1    Rs   22:58   0:00 bash
 andreas  28375  0.0  0.0   3336   804 pts/1    S+   23:00   0:00 grep bash
 andreas@andreas-desktop:~$ 

So, yes, the issue described HERE is fixed.
Comment 18 Artur Rona 2009-03-23 23:42:54 UTC
@Christian Persch
So do I need to open new bug? In tvtime or gnome-terminal?
Comment 19 Christian Persch 2009-08-17 12:43:31 UTC
*** Bug 570788 has been marked as a duplicate of this bug. ***
Comment 20 Alexandre Franke 2014-01-20 23:12:42 UTC
Closing as it's fixed. Artur, if you still have your tvtime issue, please try checking if this also happens with another terminal emulator (xterm or Konsole for instance). If it does, file a bug for tvtime, if it doesn't you can file a gnome-terminal bug.