[gnome-builder] terminal: fallback to /bin/bash when necessary



commit 658c0babe9fba7d1e221729e30fbbdae44380ac5
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 6 14:48:39 2017 -0800

    terminal: fallback to /bin/bash when necessary
    
    All the runtimes today thus far have bash, so just depend on that if we
    do not have the preferred shell in the runtime (say its zsh, fish, etc).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779678

 plugins/terminal/gb-terminal-view.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 300728c..eebec55 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -259,7 +259,15 @@ gb_terminal_respawn (GbTerminalView *self,
     IDE_GOTO (failure);
 
   if (self->runtime != NULL)
-    launcher = ide_runtime_create_launcher (self->runtime, NULL);
+    {
+      launcher = ide_runtime_create_launcher (self->runtime, NULL);
+
+      if (!ide_runtime_contains_program_in_path (self->runtime, shell, NULL))
+        {
+          g_free (shell);
+          shell = g_strdup ("/bin/bash");
+        }
+    }
 
   if (launcher == NULL)
     launcher = ide_subprocess_launcher_new (0);


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