set scrollback_lines via config

This commit is contained in:
Daniel Micay 2012-06-07 12:58:07 -04:00
parent abf580c186
commit a5cfc12864
3 changed files with 6 additions and 3 deletions

View File

@ -12,8 +12,6 @@ static const char *url_regex = "(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*";
// 0.0: opaque, 1.0: transparent // 0.0: opaque, 1.0: transparent
//#define TRANSPARENCY 0.2 //#define TRANSPARENCY 0.2
static const long scrollback_lines = 1000;
static const char *foreground_color = "#dcdccc"; static const char *foreground_color = "#dcdccc";
static const char *background_color = "#3f3f3f"; static const char *background_color = "#3f3f3f";
static const char *cursor_color = "#dcdccc"; static const char *cursor_color = "#dcdccc";

View File

@ -288,6 +288,11 @@ static void load_config(GtkWindow *window, VteTerminal *vte) {
IGNORE_ON_ERROR(error) { IGNORE_ON_ERROR(error) {
vte_terminal_set_font_from_string(vte, font); vte_terminal_set_font_from_string(vte, font);
} }
gint scrollback_lines = g_key_file_get_integer(config, "options", "scrollback_lines", &error);
IGNORE_ON_ERROR(error) {
vte_terminal_set_scrollback_lines(vte, scrollback_lines);
}
} }
g_key_file_free(config); g_key_file_free(config);
} }
@ -381,7 +386,6 @@ int main(int argc, char **argv) {
load_config(GTK_WINDOW(window), VTE_TERMINAL(vte)); load_config(GTK_WINDOW(window), VTE_TERMINAL(vte));
vte_terminal_set_scrollback_lines(VTE_TERMINAL(vte), scrollback_lines);
vte_terminal_set_cursor_shape(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_SHAPE_, CURSOR_SHAPE)); vte_terminal_set_cursor_shape(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_SHAPE_, CURSOR_SHAPE));
vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_BLINK_, CURSOR_BLINK)); vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_BLINK_, CURSOR_BLINK));

View File

@ -6,3 +6,4 @@ audible_bell = false
visible_bell = false visible_bell = false
mouse_autohide = false mouse_autohide = false
font = Monospace 9 font = Monospace 9
scrollback_lines = 1000