Index: src/terminal-options.c
===================================================================
--- src/terminal-options.c	(リビジョン 3364)
+++ src/terminal-options.c	(作業コピー)
@@ -33,6 +33,10 @@
 #include "terminal-intl.h"
 #include "terminal-util.h"
 
+#ifdef WITH_SMCLIENT
+#include "eggsmclient.h"
+#endif
+
 static GOptionContext *get_goption_context (TerminalOptions *options);
 
 static InitialTab*
@@ -635,6 +639,26 @@ digest_options_callback (GOptionContext 
   TerminalOptions *options = data;
   InitialTab    *it;
 
+#ifdef WITH_SMCLIENT
+{
+  EggSMClient *sm_client;
+
+  sm_client = egg_sm_client_get ();
+
+  if (!options->invoked_by_factory && egg_sm_client_is_resumed (sm_client))
+    {
+      GKeyFile *key_file;
+
+      key_file = egg_sm_client_get_state_file (sm_client);
+      if (key_file)
+        {
+          if (!terminal_options_merge_config (options, key_file, error))
+            return FALSE;
+        }
+    }
+}
+#endif
+
   /* make sure we have some window in case no options were given */
   if (options->initial_windows == NULL)
     it = ensure_top_tab (options);
@@ -667,6 +691,7 @@ terminal_options_parse (const char *work
                         const char *startup_id,
                         char **env,
                         gboolean ignore_unknown_options,
+                        gboolean invoked_by_factory,
                         int *argcp,
                         char ***argvp,
                         GError **error,
@@ -688,6 +713,7 @@ terminal_options_parse (const char *work
   options->default_maximize = FALSE;
   options->execute = FALSE;
   options->use_factory = TRUE;
+  options->invoked_by_factory = invoked_by_factory;
 
   options->env = g_strdupv (env);
   options->startup_id = g_strdup (startup_id && startup_id[0] ? startup_id : NULL);
Index: src/terminal-options.h
===================================================================
--- src/terminal-options.h	(リビジョン 3364)
+++ src/terminal-options.h	(作業コピー)
@@ -47,6 +47,7 @@ typedef struct
 
   gboolean  execute;
   gboolean  use_factory;
+  gboolean  invoked_by_factory;
   double    zoom;
 
   char    *config_file;
@@ -86,6 +87,7 @@ TerminalOptions *terminal_options_parse 
                                          const char *startup_id,
                                          char **env,
                                          gboolean ignore_unknown_options,
+                                         gboolean invoked_by_factory,
                                          int *argcp,
                                          char ***argvp,
                                          GError **error,
Index: src/terminal.c
===================================================================
--- src/terminal.c	(リビジョン 3364)
+++ src/terminal.c	(作業コピー)
@@ -275,6 +275,7 @@ main (int argc, char **argv)
                                     startup_id,
                                     NULL,
                                     FALSE,
+                                    FALSE,
                                     &argc, &argv,
                                     &error,
                                     gtk_get_option_group (TRUE),
@@ -542,6 +543,7 @@ terminal_factory_handle_arguments (Termi
                                     startup_id,
                                     env,
                                     TRUE,
+                                    TRUE,
                                     &argc, &argv_copy,
                                     error,
                                     NULL);
