Bug 981832

Summary: gnome-save-session won't save gnome-terminals.
Product: [Fedora] Fedora Reporter: Rick Richardson <rickrich>
Component: gnome-terminalAssignee: Matthias Clasen <mclasen>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: gczarcinski, jmccann, mclasen, robatino, rstrode, zeenix
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-11 13:58:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rick Richardson 2013-07-06 05:56:44 UTC
gnome-save-session won't save gnome-terminal's in the Cinnamon desktop.  However, it will save, for example, Firefox.

login
create a bunch of gnome-terminal's
create a firefox browser
logout

login

See, the firefox is still there, but the gnome-terminal's are not.


This worked in Fedora 17!  It is my #1 BUG, as I use 15-20 gnome-terminals constantly.

Comment 1 Rick Richardson 2013-07-06 14:53:28 UTC
OK, this also doesn't work with Gnome Shell desktop.

Comment 2 Andre Robatino 2013-07-07 22:28:59 UTC
Looks like a duplicate of bug 955592. Unfortunately that hasn't gotten any attention either.

Comment 3 Rick Richardson 2013-09-09 11:24:55 UTC
Gene Czarcinski <gene> 2013-09-07 15:44:03 UTC writes:

"Sometime between 3.6.2 and 3.8.4, in someone's infinite
wisdom, all of the session management code has been ripped out of
gnome-terminal.

At this point, yes, it could be added back in but, if there is truly a valid
reason to remove it then maybe a better approach for those of use who really
want the session management is to fork gnome-terminal 3.6.2 into a new package.
 The only current alternatives which will restore are kde's konsole and xterm
both of which are not exactly satisfactory solutions."

So, we have to use "konsole" from KDE.  Tell me, why does gnome 3 get worse and worse???

Comment 4 Gene Czarcinski 2013-09-09 15:22:14 UTC
I have tracked the change down to a specific commit which was part of 3.7.0 and, at this point, make the problem an RFE rather than a "bug".

https://git.gnome.org/browse/gnome-terminal/commit/?id=364115335f4e43908da3dba936e5d42edad4d8d0

I am not sure where such matters are discussed but I cannot find any explanation as to why smclient support was removed.  I do notice that other Gnome applications such as the gnome-tweak-tool does not support smclient either and maybe that is just making gnome-terminal consistent.  If that is the reason, my opinion is that it is not a valid reason.

I have mentioned forking gnome-terminal at the 3.6.2 version but am having second thoughts about that.  I really wish I understood the reasoning behind the removal of the smclient support from gnome-terminal and the fact that there has been so little comment about it.

Comment 5 Rick Richardson 2013-09-09 16:04:34 UTC
I tried "roxterm" based on VTE (yum install roxterm).  SM is active there, but only one terminal is saved, and the coordinates are always set to 0,0 even though I put it in another place.

Comment 6 Rick Richardson 2013-09-09 16:43:33 UTC
I tried "xfce4-terminal" based on VTE (yum install xfce4-terminal).  SM is active there, and all terminals are saved. But, the coordinates are always set to 0,Y-coord even though I put it in another place.  So it is real close, all we have to do is find out the bug that sets the X-coord to 0.

Comment 7 Gene Czarcinski 2013-09-09 18:53:38 UTC
OK, I also have been testing with xfce4-terminal.  I believe that the position on the desktop will depend on how you have things set with gnome-tweak-tool.  However, there is no attempt to put the windows on the correct desktop.  Both of these facts are true under both the Gnome 4 gnome-shell and xfce4 desktops.

There is hope here that something may be done.

BTW, even when gnome-terminal did support smclient, it did not get positioning or desktop right every time.

I also did some testing with konsole ... these is more hope/promise with xfce4-terminal.

Comment 8 Gene Czarcinski 2013-09-10 15:18:29 UTC
More info.  I finally found some documentation/discussion:
https://wiki.gnome.org/SessionManagement/EggSMClient

and

https://bugzilla.gnome.org/show_bug.cgi?id=79285

Comment 9 Gene Czarcinski 2013-09-10 16:31:46 UTC
It would have been helpful is the commit comments had been a bit more verbose in explaining what was being done.  In any case, gtk 3.4 GtkApplication picked up logout notification, etc. and EggSMClient was no longer needed:

https://developer.gnome.org/gtk3/3.7/gtk-migrating-smclient-GtkApplication.html

https://git.gnome.org/browse/gnome-terminal/commit/?id=18f819c46a6f70ae24fff07915c173d3f2d87cbc

https://git.gnome.org/browse/gnome-terminal/commit/?id=52c65f535867c59a878730bc2fb4fe86110aed38

https://git.gnome.org/browse/gnome-terminal/commit/?id=418ec12dd5c3781f0b223e744ed094062332e85e

Unfortunately, they did not complete the work and add the functionality back in of saving the session so that it could be restored.  But, this does say that the "correct" answer is to develop a patch for gnome-terminal-3.8+ which will add that functionality back in.

Comment 10 Zeeshan Ali 2013-09-10 16:42:26 UTC
I don't think gnome-session-save is supported/maintained anymore (as pointed out in comment#3) as there is no concept of session saving anymore. I think this is a clear WONTFIX.

Comment 11 Zeeshan Ali 2013-09-10 16:50:32 UTC
*** Bug 955592 has been marked as a duplicate of this bug. ***

Comment 12 Gene Czarcinski 2013-09-10 17:42:47 UTC
Sorry, I believe you are NOT correct in closing this.  You should have read all of my comments and the referenced documents.  Yes, the eggsmclient code was removed because starting with gtk 3.4, GtkApplication supported logout notification and negotiation similar to EggSMClient (removal done Decemaber 2011).  In March 2012, gnome-terminal was changed to use GtkApplication.

However, actually saving the session state appears to be a bit more difficult and has not been done yet.  I have not seen anything that says a decision has been made to not implement it.

If such a decision has been made, then where is it documented?  Why does gnome-session still support the option of automatically remembering running applications at logout?  Why is there still a org.gnome.gnome-session.auto-save-session boolean variable?

You will notice that I have reopened this as a request for enhancement and not as a bug report.  This is consistent with the report in the gnome bugzilla which is still open.

Comment 13 Zeeshan Ali 2013-09-10 18:30:22 UTC
I did this after consenting with Assignee of this bug:

<zeenix> mclasen: i marked it as WONTFIX, feel free to reopen if needed
<mclasen> zeenix: fine with me - doesn't make sense as a fedora bug anyway

Comment 14 Gene Czarcinski 2013-09-11 13:58:10 UTC
OK, after some additional thought, I have come to the conclusion that this should be closed.  As a matter of fact, I have come to the conclusion that those who argue that saving the session at logout should not be done are correct.

What I really want is to do is to autostart some applications and this is already doable.  What I am not sure of yet is how to specify that I want one gnome-terminal window started in workspace 1 and a second gnome-terminal window started in workspace 2.  The old session-save did this for me but this should be doable.

Comment 15 Rick Richardson 2013-11-19 22:19:57 UTC
Here's what I did.  It is better than nothing.

$ cat ~/bin/terminal-populate
#/bin/sh

#
#       1920x1200 monitor
#

wmctrl -s 0
gnome-terminal --geometry=80x35-0+0     # right, top
gnome-terminal --geometry=80x35-0-0     # right, bottom
gnome-terminal --geometry=80x35+0-0     # left, bottom
gnome-terminal --geometry=80x35+700-0   # center, bottom
#exit

wmctrl -s 1
gnome-terminal --geometry=80x79+0+0     # left, top
gnome-terminal --geometry=80x79+700+0   # center, top
gnome-terminal --geometry=80x79-0+0     # right, top

wmctrl -s 2
gnome-terminal --geometry=80x79+0+0     # left, top
gnome-terminal --geometry=80x79+700+0   # center, top
gnome-terminal --geometry=80x79-0+0     # right, top

wmctrl -s 0

Comment 16 Gene Czarcinski 2013-11-21 13:42:37 UTC
I do something similar by having gnome-session autostart a number of gnome-terminal and with some of them run a script.  I will have to think on this.  Your way may be better.

Comment 17 Rick Richardson 2013-11-21 15:08:50 UTC
Yes, I use gnome-session-properties to autostart terminal-populate.

$ cat ~/bin/terminal-populate 
#/bin/sh

#
#       1920x1200 monitor
#

wmctrl -s 0
# firefox       # session save worked on this one!
gnome-terminal --geometry=80x35-0+0             # right, top
WD=--working-directory=$HOME/.geo
gnome-terminal --geometry=80x35+0-0 $WD         # left, bottom
WD=--working-directory=$HOME/tmp
gnome-terminal --geometry=80x35+700-0 $WD       # center, bottom
WD=--working-directory=$HOME/proj/caches
gnome-terminal --geometry=80x35-0-0 $WD         # right, bottom

wmctrl -s 1
WD=--working-directory=$HOME/proj/geo
gnome-terminal --geometry=80x79+0+0 $WD         # left, top
gnome-terminal --geometry=80x79+700+0 $WD       # center, top
gnome-terminal --geometry=80x79-0+0 $WD         # right, top

wmctrl -s 2
WD=--working-directory=$HOME/proj/foo2zjs
gnome-terminal --geometry=80x79+0+0 $WD         # left, top
gnome-terminal --geometry=80x79+700+0 $WD       # center, top
gnome-terminal --geometry=80x79-0+0 $WD         # right, top

wmctrl -s 3
WD=--working-directory=$HOME/proj/gnome-manual-duplex
gnome-terminal --geometry=80x79+0+0 $WD         # left, top
gnome-terminal --geometry=80x79+700+0 $WD       # center, top
gnome-terminal --geometry=80x79-0+0 $WD         # right, top

wmctrl -s 0