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 575308 - Make gnome-terminal session loading work
Make gnome-terminal session loading work
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: High normal
: gnome-2-26
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
fixed-2-26
: 579208 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-03-14 00:53 UTC by Vincent Untz
Modified: 2009-04-16 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (781 bytes, patch)
2009-03-14 00:53 UTC, Vincent Untz
none Details | Review
Avoid opening a new window (483 bytes, patch)
2009-03-14 10:54 UTC, Hiroyuki Ikezoe
needs-work Details | Review
Tackled to the issue I mentioned in comment #4 (3.56 KB, patch)
2009-03-14 13:28 UTC, Hiroyuki Ikezoe
reviewed Details | Review
another way (3.54 KB, patch)
2009-03-16 03:28 UTC, Hiroyuki Ikezoe
none Details | Review

Description Vincent Untz 2009-03-14 00:53:17 UTC
There's no code at all to read the state file from saved session in gnome-terminal. Attached patch fixes this.
Comment 1 Vincent Untz 2009-03-14 00:53:43 UTC
Created attachment 130619 [details] [review]
Patch
Comment 2 Vincent Untz 2009-03-14 00:56:34 UTC
Actually, this is not 100% correct since there's always a new window being opened with the default profile, in addition to the windows saved in the state file.

(you'll need the patch from bug 552387 for gnome-session to test all this)
Comment 3 Hiroyuki Ikezoe 2009-03-14 10:54:29 UTC
Created attachment 130644 [details] [review]
Avoid opening a new window

Opening a new window is caused by invoking ensure_top_tab in digest_options_callback which is a callback function of g_option_group_set_parse_hooks. So the window always opens.
Comment 4 Hiroyuki Ikezoe 2009-03-14 11:45:21 UTC
I found another issue.

After a gnome-terminal session which has several tabs is restored, I opened a new gnome-terminal, the new gnome-terminal is opened with with several tabs which are the same of the restored one.
Comment 5 Hiroyuki Ikezoe 2009-03-14 12:24:33 UTC
Comment on attachment 130644 [details] [review]
Avoid opening a new window

Umm, this patch was wrong.
Comment 6 Hiroyuki Ikezoe 2009-03-14 13:28:43 UTC
Created attachment 130653 [details] [review]
Tackled to the issue I mentioned in comment #4
Comment 7 Christian Persch 2009-03-15 15:20:42 UTC
Why does the last patch remove checking the return value of terminal_options_merge_config()? Also I don't like how the default-window thing is moved from terminal-options to terminal-app; this should stay an internal thing. I'll try to think about how to do that...
Comment 8 Hiroyuki Ikezoe 2009-03-15 22:37:02 UTC
(In reply to comment #7)
> Why does the last patch remove checking the return value of
> terminal_options_merge_config()? Also I don't like how the default-window thing
> is moved from terminal-options to terminal-app; this should stay an internal
> thing. I'll try to think about how to do that...

Yes, I actually don't like that way too. Though I thought another way that calling 
 egg_sm_client_is_resumed in digest_options_callback(), I don't like it too.

I will think smart way.
Comment 9 Hiroyuki Ikezoe 2009-03-15 23:12:15 UTC
(In reply to comment #7)
> Why does the last patch remove checking the return value of
> terminal_options_merge_config()? 

I thought it is good to go on the process even if merge config failed, but now I think it was misreading. 


Comment 10 Hiroyuki Ikezoe 2009-03-16 03:28:46 UTC
Created attachment 130723 [details] [review]
another way

I gave up the attempt to find smart way. So I attach another patch I mentioned in comment #8.
Comment 11 Christian Persch 2009-03-19 13:52:15 UTC
I couldn't think of a nicer way either, so I used the patch from  attachment 130653 [details] [review] with only minor changes. 

Unfortunately I cannot test session resuming since I'm still using gnome 2.24; can you check it works? Testing shouldn't only test resuming a session saved by gnome-terminal 2.26, but also one saved from g-t 2.24.

Also, resuming will only work if the resume process starts the terminal factory (i.e. not with factory already running), but that shouldn't be a problem.
Comment 12 Hiroyuki Ikezoe 2009-03-20 01:12:45 UTC
(In reply to comment #11)

> Unfortunately I cannot test session resuming since I'm still using gnome 2.24;
> can you check it works? Testing shouldn't only test resuming a session saved by
> gnome-terminal 2.26, but also one saved from g-t 2.24.


I am sorry for my poor comprehension. I cannot understand what you are saying. You mean the steps like the following?

1. start gnome-terminal-2.24
2. log out with session saving
3. update gnome-terminal to 2.26
4. log in 


Comment 13 Hiroyuki Ikezoe 2009-03-20 01:23:02 UTC
Test1: single tab restoring
0. no gnome-terminal was running.
1. started gnome-terminal
2. the terminal had a tab.
3. logged out with session saving.
4. logged in.
5. gnome-terminal was restored with a tab. <= It's OK.

Test2: multiple tabs restoring
0 - 2. same as Test1.
3. open three new tabs in the gnome-terminal.
4. logged out with session saving.
5. logged in.
6. gnome-terminal was restored with four tabs. <= It's OK.

Test3: new gnome-terminal with factory
0 - 6: same as Test2.
7. start a new gnome-terminal.
8. the new terminal had a tab. <= It's OK.

Test4: new gnome-terminal without factory
0 -8: same as Test3.
9. confirmed no gnome-terminal process runnig.
10. start a new gnome-terminal
11. the new terminal had a tab. <= It's OK.


Comment 14 Hiroyuki Ikezoe 2009-03-20 01:25:45 UTC
(In reply to comment #13)

> Test4: new gnome-terminal without factory
> 0 -8: same as Test3.
> 9. confirmed no gnome-terminal process runnig.
> 10. start a new gnome-terminal
> 11. the new terminal had a tab. <= It's OK.

I forgot to write very important step. 

8.5. I stopped all gnome-terminal processes.

Comment 15 Christian Persch 2009-03-22 13:25:07 UTC
(In reply to comment #12)
> I am sorry for my poor comprehension. I cannot understand what you are saying.
> You mean the steps like the following?
> 
> 1. start gnome-terminal-2.24
> 2. log out with session saving
> 3. update gnome-terminal to 2.26
> 4. log in 

Yes.
Comment 16 Hiroyuki Ikezoe 2009-03-23 10:50:08 UTC
(In reply to comment #15)

> > 1. start gnome-terminal-2.24
> > 2. log out with session saving
> > 3. update gnome-terminal to 2.26
> > 4. log in 

Unfortunately this test failed. gnome-terminal-2.26 could not be restored from gnome-terminal-2.24 saved session. In other word, gnome-terminal-2.26 was not started by gnome-session.

session file (~/.config/gnome-session/saved-session/XXXX.desktop) of gnome-terminal-2.24 slightly differs from gnome-terminal-2.26's one. Is this problem?

-Exec=gnome-terminal --sm-config-prefix /gnome-terminal-M65mmk/ --sm-client-id 10aa88bf17eea4fe70123780473836094600000247480028 --screen 0 --window-with-profile-internal-id=Default --hide-menubar --role=gnome-terminal-window-25187--1305972804-1237804738 --working-directory /home/zoe --tab-with-profile-internal-id=Default --working-directory /home/zoe --tab-with-profile-internal-id=Default --working-directory /home/zoe --tab-with-profile-internal-id=Default --working-directory /home/zoe --tab-with-profile-internal-id=Default --active --geometry '80x24+182+104' --working-directory /home/zoe
+Exec=gnome-terminal --sm-client-id 106ffdd4e584644728123780433531307000000189090028 --sm-client-state-file /home/zoe/.config/session-state/gnome-terminal-1237804352.desktop
Comment 17 Christian Persch 2009-03-23 11:39:12 UTC
That's because the --sm-config-prefix option isn't known by eggsmclient. I've fixed this in gnome-terminal's copy, and sent the patch upstream.
Comment 18 Hiroyuki Ikezoe 2009-03-23 11:46:03 UTC
(In reply to comment #17)
> That's because the --sm-config-prefix option isn't known by eggsmclient. I've
> fixed this in gnome-terminal's copy, and sent the patch upstream.

I confirmed that gnome-terminal rev. 3387 can be restored from gnome-terminal-2.24 session.
Comment 19 Christian Persch 2009-03-30 17:39:19 UTC
Thanks! Let's call this FIXED then and if you find any more issues with session save or restore, please open a new bug.
Comment 20 Chris Coulson 2009-04-16 20:24:21 UTC
*** Bug 579208 has been marked as a duplicate of this bug. ***