Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Mon, 06 Mar 2023 21:52:04 UTC Commit: 1bed7a2f9b84c5016022979becb6d6e6f58b886c https://github.com/geany/geany-osx/commit/1bed7a2f9b84c5016022979becb6d6e6f5...
Log Message: ----------- Update login shell patch to latest changes in master
Modified Paths: -------------- geany.modules geany_patches/03git-geany_vte_login_shell.patch
Modified: geany.modules 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -113,7 +113,7 @@ <!-- This patch corresponds to https://github.com/geany/geany/pull/2363 --> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/01git-geany_config_shell.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/02-geany_scintilla_candidate_window_pos.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/03-geany_vte_login_shell.patch" strip="1" /> + <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/03git-geany_vte_login_shell.patch" strip="1" /> </branch> <dependencies> <dep package="geany-deps" />
Modified: geany_patches/03git-geany_vte_login_shell.patch 70 lines changed, 70 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,70 @@ +From 11ae19d0df6bf5715c1a92f9b1f5f5fe07621174 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com +Date: Sat, 9 Nov 2019 11:07:19 -0800 +Subject: [PATCH 2/2] Make sure any shell used in VTE is run as login shell on + macOS + +Previously we did this for bash only but we should do it for arbitrary +shell. The -l option seems to be supported by all major shells. + +Previously we used to add -l to the settings value itself which probably +isn't the cleanest way as the entry should contain path. Let's add +it invisibly to user but make sure we don't add it when settings already +contains -l. +--- + src/keyfile.c | 7 ------- + src/vte.c | 12 +++++++++++- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/keyfile.c b/src/keyfile.c +index d4daa0b2f..92d3ac93c 100644 +--- a/src/keyfile.c ++++ b/src/keyfile.c +@@ -980,13 +980,6 @@ 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 +- + 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) + /* last dir is not set, fallback to user's home directory */ +diff --git a/src/vte.c b/src/vte.c +index ec8c5df37..3b798de40 100644 +--- a/src/vte.c ++++ b/src/vte.c +@@ -485,8 +485,17 @@ static void vte_commit_cb(VteTerminal *vte, gchar *arg1, guint arg2, gpointer us + + static void vte_start(GtkWidget *widget) + { ++ gchar *shell = g_strdup(vte_config.shell); ++ ++#ifdef __APPLE__ ++ /* run as a login shell as macOS doesn't load any configuration when ++ * user is logged in and this is the only way to load config files */ ++ if (strstr(shell, " -l") == NULL) ++ SETPTR(shell, g_strconcat(shell, " -l", NULL)); ++#endif ++ + /* split the shell command line, so arguments will work too */ +- gchar **argv = g_strsplit(vte_config.shell, " ", -1); ++ gchar **argv = g_strsplit(shell, " ", -1); + + if (argv != NULL) + { +@@ -513,6 +522,7 @@ static void vte_start(GtkWidget *widget) + pid = 0; /* use 0 as invalid pid */ + + set_clean(TRUE); ++ g_free(shell); + } + + +-- +2.17.1 +
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).