--- terminal-window.c.orig	Thu Aug  7 19:00:42 2003
+++ terminal-window.c	Thu Aug  7 21:39:52 2003
@@ -1712,8 +1712,12 @@
   TerminalScreen *screen;
   GtkWidget *menu_item;
   int old_grid_width, old_grid_height;
+  GtkWidget *widget;
   GtkWidget *old_widget;
-  
+  GtkWidget *scrollbar;
+  gboolean old_has_scrollbar;
+  int char_width, char_height;
+
   old_widget = NULL;
   old_grid_width = -1;
   old_grid_height = -1;
@@ -1722,6 +1726,10 @@
     {
       old_widget = terminal_screen_get_widget (window->priv->active_term);
       terminal_widget_get_size (old_widget, &old_grid_width, &old_grid_height);
+
+      /* We must know if the old term has the scrollbar visible */
+      scrollbar = screen_get_scrollbar (window->priv->active_term);
+      old_has_scrollbar =  GTK_WIDGET_VISIBLE (scrollbar);
     }
   
   page_widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook),
@@ -1734,6 +1742,17 @@
   g_assert (screen);
 
   terminal_window_set_active (window, screen);
+
+    /* if the new scrollbar is visible and the old isn't, remove the space */
+    scrollbar = screen_get_scrollbar (screen);
+    if (GTK_WIDGET_VISIBLE (scrollbar) && !old_has_scrollbar)
+    {
+      GtkRequisition size;
+      gtk_widget_size_request (scrollbar, &size);
+      widget = terminal_screen_get_widget (screen);
+      terminal_widget_get_cell_size (widget, &char_width, &char_height);
+      old_grid_width -= size.width / char_width;
+    }
 
   /* This is so we maintain the same grid moving among tabs with
    * different fonts.
