[gnome-builder] terminal: set SHELL when spawning terminal



commit d0a5283387f3f283d4f4db8c7c15e2fc66985c4c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 16 09:57:57 2016 -0700

    terminal: set SHELL when spawning terminal

 plugins/terminal/gb-terminal-view.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 1345d8d..855bcd4 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -118,6 +118,7 @@ gb_terminal_respawn (GbTerminalView *self,
   g_autoptr(IdeSubprocess) subprocess = NULL;
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autofree gchar *workpath = NULL;
+  g_autofree gchar *shell = NULL;
   GtkWidget *toplevel;
   GError *error = NULL;
   IdeContext *context;
@@ -178,6 +179,7 @@ gb_terminal_respawn (GbTerminalView *self,
   if (-1 == (tty_fd = open (name, O_RDWR | O_CLOEXEC)))
     IDE_GOTO (failure);
 
+  shell = vte_get_user_shell ();
 
   /* XXX: It would be nice to allow using the runtimes launcher */
   launcher = ide_subprocess_launcher_new (0);
@@ -191,6 +193,9 @@ gb_terminal_respawn (GbTerminalView *self,
   ide_subprocess_launcher_setenv (launcher, "TERM", "xterm-256color", TRUE);
   ide_subprocess_launcher_setenv (launcher, "INSIDE_GNOME_BUILDER", PACKAGE_VERSION, TRUE);
 
+  if (shell != NULL)
+    ide_subprocess_launcher_setenv (launcher, "SHELL", shell, TRUE);
+
   subprocess = ide_subprocess_launcher_spawn_sync (launcher, NULL, &error);
   if (subprocess == NULL)
     IDE_GOTO (failure);


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