[gnome-terminal] Increase scrollback limit to 1e7 lines



commit 7f24cfe264be4575d965dfa4704d4ead74442143
Author: Christian Persch <chpe gnome org>
Date:   Tue Sep 8 21:36:11 2009 +0200

    Increase scrollback limit to 1e7 lines
    
    Update estimate of memory used by scrollback to new vte code.

 src/profile-editor.c          |    7 +++----
 src/profile-preferences.glade |    2 +-
 src/terminal-profile.c        |    4 +++-
 3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index a82a1e0..08160a6 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -29,9 +29,8 @@
 #include "profile-editor.h"
 #include "terminal-util.h"
 
-/* One slot in the ring buffer, plus the array which holds the data for
-  * the line, plus about 80 vte_charcell structures. */
-#define BYTES_PER_LINE (sizeof(gpointer) + sizeof(GArray) + (80 * (sizeof(gunichar) + 4)))
+/* Behdad estimates this to about 1 byte/cell, approx. */
+#define BYTES_PER_LINE ((goffset) 80)
 
 typedef struct _TerminalColorScheme TerminalColorScheme;
 
@@ -469,7 +468,7 @@ scrollback_lines_spin_button_changed_cb (GtkSpinButton *button,
   char *kbtext, *text;
 
   lines = gtk_spin_button_get_value (button);
-  kbtext = g_format_size_for_display (lines * BYTES_PER_LINE);
+  kbtext = g_format_size_for_display (((goffset) (lines + 0.5)) * BYTES_PER_LINE);
   /* Translators: %s will be a data size, e.g. "(about 500kB)" */
   text = g_strdup_printf (_("(about %s)"), kbtext);
   gtk_label_set_text (label, text);
diff --git a/src/profile-preferences.glade b/src/profile-preferences.glade
index ae20b44..7ce2894 100644
--- a/src/profile-preferences.glade
+++ b/src/profile-preferences.glade
@@ -2116,7 +2116,7 @@ Disabled</property>
 		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		      <property name="snap_to_ticks">False</property>
 		      <property name="wrap">False</property>
-		      <property name="adjustment">1 1 100000 1 5 0</property>
+		      <property name="adjustment">1 1 10000000 1 100 0</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
diff --git a/src/terminal-profile.c b/src/terminal-profile.c
index 3e8f08a..cafb71d 100644
--- a/src/terminal-profile.c
+++ b/src/terminal-profile.c
@@ -150,6 +150,8 @@ enum
 #define DEFAULT_VISIBLE_NAME          (N_("Unnamed"))
 #define DEFAULT_WORD_CHARS            ("-A-Za-z0-9,./?%&#:_=+ ~")
 
+#define MAX_SCROLLBACK_LINES          (10000000)
+
 struct _TerminalProfilePrivate
 {
   GValueArray *properties;
@@ -1303,7 +1305,7 @@ terminal_profile_class_init (TerminalProfileClass *klass)
   TERMINAL_PROFILE_PROPERTY_ENUM (SCROLLBAR_POSITION, TERMINAL_TYPE_SCROLLBAR_POSITION, DEFAULT_SCROLLBAR_POSITION, KEY_SCROLLBAR_POSITION);
   TERMINAL_PROFILE_PROPERTY_ENUM (TITLE_MODE, TERMINAL_TYPE_TITLE_MODE, DEFAULT_TITLE_MODE, KEY_TITLE_MODE);
 
-  TERMINAL_PROFILE_PROPERTY_INT (SCROLLBACK_LINES, 1, G_MAXINT, DEFAULT_SCROLLBACK_LINES, KEY_SCROLLBACK_LINES);
+  TERMINAL_PROFILE_PROPERTY_INT (SCROLLBACK_LINES, 1, MAX_SCROLLBACK_LINES, DEFAULT_SCROLLBACK_LINES, KEY_SCROLLBACK_LINES);
 
   TERMINAL_PROFILE_PROPERTY_OBJECT (BACKGROUND_IMAGE, GDK_TYPE_PIXBUF, NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]