[giggle] plugins/giggle-view-terminal.c: Fix crash when opening a terminal
- From: Javier JardÃn <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giggle] plugins/giggle-view-terminal.c: Fix crash when opening a terminal
- Date: Fri, 21 Oct 2011 00:44:24 +0000 (UTC)
commit 65a9a6f0421fa9407de9e8f0853bfa6f23ff37a0
Author: Javier JardÃn <jjardon gnome org>
Date: Thu Oct 20 21:49:31 2011 +0100
plugins/giggle-view-terminal.c: Fix crash when opening a terminal
plugins/giggle-view-terminal.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/plugins/giggle-view-terminal.c b/plugins/giggle-view-terminal.c
index b4604fb..3a1441c 100644
--- a/plugins/giggle-view-terminal.c
+++ b/plugins/giggle-view-terminal.c
@@ -163,6 +163,8 @@ giggle_view_terminal_append_tab (GiggleViewTerminal *view,
GError *error = NULL;
GSpawnFlags spawn_flags;
char *title;
+ const gchar *shell;
+ gchar **real_argv;
gboolean succes;
int i;
@@ -180,15 +182,23 @@ giggle_view_terminal_append_tab (GiggleViewTerminal *view,
G_CALLBACK (giggle_clipboard_changed), view);
pty_flags = VTE_PTY_NO_LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP;
- spawn_flags = G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH;
+ shell = g_getenv ("SHELL");
+ real_argv = g_new (char *, 2);
+ real_argv[0] = g_strdup (shell ? shell : "/bin/sh");
+ real_argv[1] = NULL;
+ spawn_flags = G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH | G_SPAWN_FILE_AND_ARGV_ZERO;
succes = vte_terminal_fork_command_full (VTE_TERMINAL (terminal),
pty_flags,
- directory, NULL, NULL,
+ directory,
+ real_argv,
+ NULL,
spawn_flags,
NULL, NULL,
NULL,
&error);
+ g_strfreev (real_argv);
+
if (succes == FALSE) {
g_warning ("%s: %s: vte_terminal_fork_command_full failed %s",
G_STRLOC, G_STRFUNC, error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]