Index: terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.85
diff -u -u -r1.85 terminal-screen.c
--- terminal-screen.c	18 Nov 2003 00:37:10 -0000	1.85
+++ terminal-screen.c	22 Jan 2004 09:34:04 -0000
@@ -57,6 +57,7 @@
   char *raw_title, *raw_icon_title;
   char *cooked_title, *cooked_icon_title;
   gboolean icon_title_set;
+  gboolean text_notify;
   char *matched_string;
   char **override_command;
   GtkWidget *title_editor;
@@ -72,6 +73,7 @@
 
 enum {
   PROFILE_SET,
+  CURSOR_MOVED,
   TITLE_CHANGED,
   ICON_TITLE_CHANGED,
   SELECTION_CHANGED,
@@ -90,6 +92,8 @@
                                                     GdkEventButton *event,
                                                     TerminalScreen *screen);
 
+static void terminal_screen_widget_cursor_moved     (GtkWidget      *term,
+                                                         TerminalScreen *screen);
 static void terminal_screen_widget_title_changed      (GtkWidget      *term,
                                                        TerminalScreen *screen);
 static void terminal_screen_widget_icon_title_changed (GtkWidget      *term,
@@ -271,6 +275,9 @@
                     G_CALLBACK (terminal_screen_button_press_event),
                     screen);
 
+  terminal_widget_connect_cursor_moved (screen->priv->term,
+                                        G_CALLBACK (terminal_screen_widget_cursor_moved),
+                                        screen);
   terminal_widget_connect_title_changed (screen->priv->term,
                                          G_CALLBACK (terminal_screen_widget_title_changed),
                                          screen);
@@ -322,6 +329,15 @@
                   NULL, NULL,
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
+  signals[CURSOR_MOVED] =
+    g_signal_new ("cursor_moved",
+                  G_OBJECT_CLASS_TYPE (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (TerminalScreenClass, cursor_moved),
+                  NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
+ 
   
   signals[ICON_TITLE_CHANGED] =
     g_signal_new ("icon_title_changed",
@@ -439,6 +455,16 @@
   screen->priv->window = window;
 }
 
+void
+terminal_screen_set_notify (TerminalScreen *screen,
+                            gboolean value)
+{
+  if (screen->priv->text_notify != value)
+    terminal_window_set_highlight (screen->priv->window, screen, value);
+
+  screen->priv->text_notify = value;
+}
+
 const char*
 terminal_screen_get_title (TerminalScreen *screen)
 {
@@ -1872,6 +1898,21 @@
 }
 
 static void
+terminal_screen_widget_cursor_moved (GtkWidget      *widget,
+                                     TerminalScreen *screen)
+{
+  TerminalWindow *window = terminal_screen_get_window (screen);
+	
+  if (screen == terminal_window_get_active (window) ||
+      screen->priv->text_notify == TRUE) {
+        return;
+  }
+
+  terminal_screen_set_notify (screen, TRUE);
+
+}
+
+static void
 terminal_screen_widget_icon_title_changed (GtkWidget      *widget,
                                            TerminalScreen *screen)
 {
Index: terminal-screen.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.h,v
retrieving revision 1.9
diff -u -u -r1.9 terminal-screen.h
--- terminal-screen.h	13 Oct 2003 02:49:18 -0000	1.9
+++ terminal-screen.h	22 Jan 2004 09:34:04 -0000
@@ -53,6 +53,7 @@
 
   void (* profile_set)        (TerminalScreen *screen);
   void (* title_changed)      (TerminalScreen *screen);
+  void (* cursor_moved)       (TerminalScreen *screen);
   void (* icon_title_changed) (TerminalScreen *screen);
   void (* selection_changed)  (TerminalScreen *screen);
   void (* encoding_changed)   (TerminalScreen *screen);
@@ -68,6 +69,9 @@
 void terminal_screen_set_window (TerminalScreen *screen,
                                  TerminalWindow *window);
 
+void terminal_screen_set_notify (TerminalScreen *screen,
+                                 gboolean        value);
+
 void terminal_screen_set_profile (TerminalScreen *screen,
                                   TerminalProfile *profile);
 TerminalProfile* terminal_screen_get_profile (TerminalScreen *screen);
Index: terminal-widget-vte.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget-vte.c,v
retrieving revision 1.32
diff -u -u -r1.32 terminal-widget-vte.c
--- terminal-widget-vte.c	1 Oct 2003 00:06:17 -0000	1.32
+++ terminal-widget-vte.c	22 Jan 2004 09:34:06 -0000
@@ -393,6 +393,23 @@
   vte_terminal_reset (VTE_TERMINAL(widget), TRUE, also_clear_afterward);
 }
 
+void
+terminal_widget_connect_cursor_moved (GtkWidget *widget,
+                                      GCallback  callback,
+                                      void      *data)
+{
+  g_signal_connect (widget, "cursor_moved",
+                    G_CALLBACK (callback), data);
+}
+
+void
+terminal_widget_disconnect_cursor_moved (GtkWidget *widget,
+                                         GCallback  callback,
+                                         void      *data)
+{
+  g_signal_handlers_disconnect_by_func (widget, callback, data);
+}
+
 
 void
 terminal_widget_connect_title_changed (GtkWidget *widget,
Index: terminal-widget.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget.h,v
retrieving revision 1.8
diff -u -u -r1.8 terminal-widget.h
--- terminal-widget.h	3 Dec 2002 04:07:17 -0000	1.8
+++ terminal-widget.h	22 Jan 2004 09:34:06 -0000
@@ -103,6 +103,12 @@
 void       terminal_widget_reset                      (GtkWidget            *widget,
                                                        gboolean              also_clear_afterward);
 
+void terminal_widget_connect_cursor_moved         (GtkWidget *widget,
+                                                   GCallback  callback,
+                                                   void      *data);
+void terminal_widget_disconnect_cursor_moved      (GtkWidget *widget,
+                                                   GCallback  callback,
+                                                   void      *data);
 void terminal_widget_connect_title_changed         (GtkWidget *widget,
                                                     GCallback  callback,
                                                     void      *data);
Index: terminal-window.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.c,v
retrieving revision 1.85
diff -u -u -r1.85 terminal-window.c
--- terminal-window.c	21 Jan 2004 20:47:04 -0000	1.85
+++ terminal-window.c	22 Jan 2004 09:34:13 -0000
@@ -1490,6 +1490,7 @@
 
   if (window->priv->active_term)
     {
+      terminal_screen_set_notify (window->priv->active_term, FALSE);
 #ifdef DEBUG_GEOMETRY
       g_print ("setting size with forced grid after removing a terminal\n");
 #endif
@@ -1499,7 +1500,7 @@
 
   reset_tab_menuitems (window);
   update_tab_sensitivity (window);
-  
+
   /* Close window if no more terminals */
   if (window->priv->terms == NULL)
     gtk_widget_destroy (GTK_WIDGET (window));
@@ -1802,6 +1803,7 @@
   g_assert (screen);
 
   terminal_window_set_active (window, screen);
+  terminal_screen_set_notify (screen, FALSE);
 
   /* This is so we maintain the same grid moving among tabs with
    * different fonts.
@@ -2186,6 +2188,35 @@
   return window->priv->fullscreen;
 }
 
+void
+terminal_window_set_highlight (TerminalWindow *window,
+                               TerminalScreen *screen,
+                               gboolean        value)
+{
+  GtkWidget *page, *label;
+  const char *text;
+  char *markup;
+  int num = g_list_index (window->priv->terms, screen);
+  page = gtk_notebook_get_nth_page (GTK_NOTEBOOK
+                                    (window->priv->notebook), num);
+  label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (window->priv->notebook),
+                                      page);
+  text = gtk_label_get_text (GTK_LABEL (label));
+
+  if (value == TRUE)
+    {
+       markup = g_strdup_printf ("<span color=\"blue\">%s</span>", text);
+
+       gtk_label_set_markup (GTK_LABEL (label), markup);
+       g_free (markup);
+		
+    }
+  else
+    {
+       gtk_label_set_text (GTK_LABEL (label), text);
+    }
+}
+
 /*
  * Callbacks for the menus
  */
Index: terminal-window.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.h,v
retrieving revision 1.9
diff -u -u -r1.9 terminal-window.h
--- terminal-window.h	5 Dec 2002 20:39:12 -0000	1.9
+++ terminal-window.h	22 Jan 2004 09:34:13 -0000
@@ -92,6 +92,10 @@
                                          gboolean        setting);
 gboolean terminal_window_get_fullscreen (TerminalWindow *window);
 
+void terminal_window_set_highlight (TerminalWindow *window,
+                                    TerminalScreen *screen,
+                                    gboolean        value);
+
 void terminal_window_reread_profile_list (TerminalWindow *window);
 
 void terminal_window_set_startup_id (TerminalWindow *window,
