aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormutantturkey <mutantturkey@gmail.com>2012-05-28 12:43:14 -0400
committermutantturkey <mutantturkey@gmail.com>2012-05-28 12:43:14 -0400
commitca8652dfd388185232d30aa1d29fe7d0aba84e63 (patch)
tree14129c20a17cf21571b905a7a319c23d76673b69
parent51ec8d5730a63fade051c99e18e967235ed0d25d (diff)
added a fix for deprecated terminal fork command warnings
-rw-r--r--svte.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/svte.c b/svte.c
index 70e7555..bc6d7e5 100644
--- a/svte.c
+++ b/svte.c
@@ -35,7 +35,7 @@ static struct {
typedef struct term {
GtkWidget *vte;
GtkWidget *label;
- pid_t pid;
+ GPid *pid;
} term;
@@ -259,7 +259,14 @@ static void tab_new() {
struct term *previous = get_page_term(NULL,
gtk_notebook_get_current_page(GTK_NOTEBOOK(svte.notebook)));
-
+
+ char **args = 0;
+ const gchar *shell = g_getenv("SHELL");
+ if (!shell) {
+ shell = "/bin/sh";
+ }
+ g_shell_parse_argv(shell, 0, &args, 0);
+
t = g_new0(term, 1);
t->label = gtk_label_new("");
t->vte = vte_terminal_new();
@@ -269,12 +276,15 @@ static void tab_new() {
if (index == 0) {
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(svte.notebook), FALSE);
- t->pid = vte_terminal_fork_command(VTE_TERMINAL(t->vte), NULL, NULL, NULL, NULL,
- FALSE, FALSE, FALSE);
+ vte_terminal_fork_command_full(VTE_TERMINAL(t->vte),
+ VTE_PTY_DEFAULT, NULL,
+ args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, t->pid, NULL);
tab_geometry_hints(t);
} else {
- t->pid = vte_terminal_fork_command(VTE_TERMINAL(t->vte), NULL, NULL, NULL, tab_get_cwd(previous),
- FALSE, FALSE, FALSE);
+
+ vte_terminal_fork_command_full(VTE_TERMINAL(t->vte),
+ VTE_PTY_DEFAULT, tab_get_cwd(previous),
+ args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, t->pid, NULL);
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(svte.notebook), TRUE);
}