From 942d4c6b7fbc10eaf984b4c6d51fcf4efd56f2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= Date: Mon, 6 Apr 2015 19:19:55 +0200 Subject: [PATCH] Start bash as a login shell in VTE under OS X Graphical applications on OS X are started using launchd and don't inherit shell's environment variables so we don't get the PS1 value. Do the same as the OS X terminal emulator which runs the shell as a login shell (and yes, on OS X .bash_profile is read for shells started in the terminal application instead of .bashrc). --- src/keyfile.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/keyfile.c b/src/keyfile.c index 4c025a68..97a3a869 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -861,6 +861,13 @@ static void load_dialog_prefs(GKeyFile *config) struct passwd *pw = getpwuid(getuid()); const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh"; +#ifdef __APPLE__ + /* Geany is started using launchd on OS X and we don't get any environment variables + * so PS1 isn't defined. Start as a login shell to read the corresponding config files. */ + if (strcmp(shell, "/bin/bash") == 0) + shell = "/bin/bash -l"; +#endif + vc = g_new0(VteConfig, 1); vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL); if ((vte_info.dir == NULL || utils_str_equal(vte_info.dir, "")) && pw != NULL)