--- src/terminal-options.c	2009-04-14 22:37:24.000000000 +0530
+++ src/terminal-options.c.new	2009-04-14 22:37:20.000000000 +0530
@@ -51,6 +51,7 @@
   it->zoom = 1.0;
   it->zoom_set = FALSE;
   it->active = FALSE;
+  it->attach_window = FALSE;
 
   return it;
 }
@@ -305,18 +306,25 @@
 {
   TerminalOptions *options = data;
   gboolean is_profile_id;
+  InitialWindow *iw;
+  InitialTab *it;
+
 
   is_profile_id = g_str_has_suffix (option_name, "-with-profile-internal-id");
 
   if (options->initial_windows)
     {
-      InitialWindow *iw;
-
       iw = g_list_last (options->initial_windows)->data;
       iw->tabs = g_list_append (iw->tabs, initial_tab_new (value, is_profile_id));
     }
   else
-    add_new_window (options, value, is_profile_id);
+    {
+      iw = add_new_window (options, value, is_profile_id);
+      it = g_list_last(iw->tabs)->data;
+
+      /* Attach to a previous window */
+      it->attach_window = TRUE;
+    }
 
   return TRUE;
 }
--- src/terminal-options.h	2009-04-14 22:32:32.000000000 +0530
+++ src/terminal-options.h.new	2009-04-14 22:32:27.000000000 +0530
@@ -64,6 +64,8 @@
   double zoom;
   guint zoom_set : 1;
   guint active : 1;
+
+  gboolean attach_window;	/* Tell if we attach to a previous window */
 } InitialTab;
 
 typedef struct
--- src/terminal-app.c	2009-04-14 22:40:21.000000000 +0530
+++ src/terminal-app.c.new	2009-04-14 22:40:18.000000000 +0530
@@ -1717,7 +1717,7 @@
   for (lw = options->initial_windows;  lw != NULL; lw = lw->next)
     {
       InitialWindow *iw = lw->data;
-      TerminalWindow *window;
+      TerminalWindow *window = NULL;
       GList *lt;
 
       g_assert (iw->tabs);
@@ -1722,23 +1722,33 @@
 
       g_assert (iw->tabs);
 
-      /* Create & setup new window */
-      window = terminal_app_new_window (app, screen);
+      /* Create & setup new window
+       * If we're opening a new tab we simply attach to the latest opened window */
 
-      if (options->startup_id)
-        terminal_window_set_startup_id (window, options->startup_id);
-
-      /* Overwrite the default, unique window role set in terminal_window_init */
-      if (iw->role)
-        gtk_window_set_role (GTK_WINDOW (window), iw->role);
-
-      if (iw->force_menubar_state)
-        terminal_window_set_menubar_visible (window, iw->menubar_state);
-
-      if (iw->start_fullscreen)
-        gtk_window_fullscreen (GTK_WINDOW (window));
-      if (iw->start_maximized)
-        gtk_window_maximize (GTK_WINDOW (window));
+      if ( lw == options->initial_windows && ((InitialTab *)iw->tabs->data)->attach_window )
+        {
+	  window = terminal_app_get_current_window (app);
+        }
+      
+       if ( !window )
+        {
+          window = terminal_app_new_window (app, screen);
+ 
+          if (options->startup_id)
+            terminal_window_set_startup_id (window, options->startup_id);
+ 
+          /* Overwrite the default, unique window role set in terminal_window_init */
+          if (iw->role)
+            gtk_window_set_role (GTK_WINDOW (window), iw->role);
+ 
+          if (iw->force_menubar_state)
+            terminal_window_set_menubar_visible (window, iw->menubar_state);
+ 
+          if (iw->start_fullscreen)
+            gtk_window_fullscreen (GTK_WINDOW (window));
+          if (iw->start_maximized)
+            gtk_window_maximize (GTK_WINDOW (window));
+	}
 
       /* Now add the tabs */
       for (lt = iw->tabs; lt != NULL; lt = lt->next)
@@ -1867,6 +1877,9 @@
 TerminalWindow *
 terminal_app_get_current_window (TerminalApp *app)
 {
+  if ( !app->windows )
+    return NULL;
+
   return g_list_last (app->windows)->data;
 }
 
