[gnome-builder/gnome-builder-43] plugins/shellcmd: use preferred shell when requested
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-43] plugins/shellcmd: use preferred shell when requested
- Date: Tue, 27 Sep 2022 22:12:56 +0000 (UTC)
commit ff2b6608f51a9210bdf9bb12def598b4ff72c095
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 27 15:12:30 2022 -0700
plugins/shellcmd: use preferred shell when requested
Try to use the users preferred shell if it is available in the runtime
and supports -c.
src/plugins/shellcmd/gbp-shellcmd-run-command.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/shellcmd/gbp-shellcmd-run-command.c b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
index 719c09902..ec9bc69fd 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-run-command.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
@@ -24,6 +24,8 @@
#include <glib/gi18n.h>
+#include "ide-run-context-private.h"
+
#include "gbp-shellcmd-enums.h"
#include "gbp-shellcmd-run-command.h"
@@ -123,7 +125,13 @@ gbp_shellcmd_run_command_prepare_to_run (IdeRunCommand *run_command,
}
if (self->use_shell)
- ide_run_context_push_shell (run_context, FALSE);
+ {
+ if (runtime != NULL &&
+ ide_runtime_contains_program_in_path (runtime, ide_get_user_shell (), NULL))
+ _ide_run_context_push_user_shell (run_context, FALSE);
+ else
+ ide_run_context_push_shell (run_context, FALSE);
+ }
IDE_RUN_COMMAND_CLASS (gbp_shellcmd_run_command_parent_class)->prepare_to_run (run_command, run_context,
context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]