Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.420
diff -u -b -B -r1.420 vte.c
--- src/vte.c	29 Apr 2005 20:17:41 -0000	1.420
+++ src/vte.c	5 Jun 2005 18:37:24 -0000
@@ -1264,6 +1265,48 @@
 		vte_terminal_emit_selection_changed(terminal);
 		vte_invalidate_all(terminal);
 	}
+}
+
+/* Select everything and refresh the screen if needed. */
+void
+vte_terminal_select_all(VteTerminal *terminal)
+{
+	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+	
+	long low, high, delta;
+
+	vte_terminal_deselect_all(terminal);
+
+	delta = terminal->pvt->screen->scroll_delta;
+	printf("low= %d, high = %d, delta = %d, rows = %d, columns = %d\n", low, high, delta, terminal->row_count, terminal->column_count);
+
+	terminal->pvt->has_selection = TRUE;
+	terminal->pvt->selecting_had_delta = TRUE;
+	terminal->pvt->selecting_restart = FALSE;
+1
+	terminal->pvt->selection_start.x = 0;
+	terminal->pvt->selection_start.y = 0;
+	terminal->pvt->selection_end.x = terminal->column_count;
+	terminal->pvt->selection_end.y = delta + terminal->row_count;
+
+
+#ifdef VTE_DEBUG
+		if (_vte_debug_on(VTE_DEBUG_SELECTION)) {
+			fprintf(stderr, "Selecting all text.\n");
+		}
+#endif
+
+	terminal->pvt->selection =
+		vte_terminal_get_text_range(terminal,
+					    terminal->pvt->selection_start.y,
+					    0,
+					    terminal->pvt->selection_end.y,
+					    terminal->column_count,
+					    vte_cell_is_selected,
+					    NULL,
+					    NULL);
+
+	vte_terminal_emit_selection_changed(terminal);
 }
 
 /* Reset the set of tab stops to the default. */
Index: src/vte.h
===================================================================
RCS file: /cvs/gnome/vte/src/vte.h,v
retrieving revision 1.78
diff -u -b -B -r1.78 vte.h
--- src/vte.h	1 May 2004 07:12:51 -0000	1.78
+++ src/vte.h	5 Jun 2005 18:37:24 -0000
@@ -230,6 +230,8 @@
 void vte_terminal_copy_primary(VteTerminal *terminal);
 void vte_terminal_paste_primary(VteTerminal *terminal);
 
+void vte_terminal_select_all(VteTerminal *terminal);
+
 /* Set the terminal's size. */
 void vte_terminal_set_size(VteTerminal *terminal,
 			   glong columns, glong rows);
