diff options
author | mutantturkey <mutantturkey@gmail.com> | 2012-05-28 12:53:25 -0400 |
---|---|---|
committer | mutantturkey <mutantturkey@gmail.com> | 2012-05-28 12:53:25 -0400 |
commit | 78923c405a2634b77d0c59c06c3240444460cab7 (patch) | |
tree | 12af6deb72a2b4a212bd538ea45e0dee4bc128d6 /svte.c | |
parent | e67f173ba29f09742bca4a0c6418205341bb86c8 (diff) |
added a few more fixes - thanks Wouter Van Rooy
Diffstat (limited to 'svte.c')
-rw-r--r-- | svte.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -51,6 +51,7 @@ static void tab_new(); static void configure_window(); static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data); +static void set_window_title(guint page_num, term *t); static GQuark term_data_id = 0; @@ -241,10 +242,7 @@ static void tab_title(GtkWidget *widget, term *t) { } -static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, - guint page_num, gpointer user_data) { - struct term *t; - t = get_page_term(NULL, page_num); +static void set_window_title(guint page_num, term *t){ const char *title = vte_terminal_get_window_title(VTE_TERMINAL(t->vte)); if (title == NULL) { title = "svte"; @@ -253,6 +251,14 @@ static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, } +static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, + guint page_num, gpointer user_data) { + struct term *t; + t = get_page_term(NULL, page_num); + set_window_title(page_num, t); +} + + static void tab_new() { term *t; int *tmp; @@ -261,7 +267,7 @@ static void tab_new() { char **args = 0; const gchar *shell = g_getenv("SHELL"); if (!shell) { - shell = "/bin/sh"; + shell = "sh"; } g_shell_parse_argv(shell, 0, &args, 0); @@ -320,9 +326,7 @@ static void tab_new() { vte_terminal_match_set_cursor_type(VTE_TERMINAL(t->vte), *tmp, GDK_HAND2); g_free(tmp); - - gtk_window_set_title(GTK_WINDOW(svte.win), - vte_terminal_get_window_title(VTE_TERMINAL(t->vte))); + set_window_title(index, t); gtk_widget_show_all(svte.notebook); gtk_notebook_set_current_page(GTK_NOTEBOOK(svte.notebook), index); gtk_widget_grab_focus(t->vte); |