--- terminal-window.c	Fri Aug  6 08:27:44 2004
+++ terminal-window.new.c	Thu Oct 28 11:25:35 2004
@@ -2638,14 +2638,24 @@
 next_tab_callback(GtkWidget      *menuitem,
                   TerminalWindow *window)
 {
-  gtk_notebook_next_page (GTK_NOTEBOOK (window->priv->notebook));
+  GtkNotebook *notebook = GTK_NOTEBOOK (window->priv->notebook);
+
+  if (gtk_notebook_get_current_page(notebook) == gtk_notebook_get_n_pages(notebook) - 1)
+    gtk_notebook_set_current_page (notebook, 0);
+  else
+    gtk_notebook_next_page (notebook);
 }
 
 static void
 previous_tab_callback (GtkWidget      *menuitem,
                        TerminalWindow *window)
 {
-  gtk_notebook_prev_page (GTK_NOTEBOOK (window->priv->notebook));
+   GtkNotebook *notebook = GTK_NOTEBOOK (window->priv->notebook);
+
+  if (gtk_notebook_get_current_page(notebook) == 0)
+    gtk_notebook_set_current_page (notebook, gtk_notebook_get_n_pages (notebook) - 1);
+  else
+    gtk_notebook_prev_page (notebook);
 }
 
 static void
