diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 8bc1048cd..2773238bf 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "sway/commands.h" #include "sway/config.h" #include "sway/server.h" @@ -14,6 +15,8 @@ #include "log.h" #include "stringop.h" +extern char** child_envp; + struct cmd_results *cmd_exec_validate(int argc, char **argv) { struct cmd_results *error = NULL; if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { @@ -81,7 +84,7 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { if (ctx && !no_startup_id) { export_startup_id(ctx); } - execlp("sh", "sh", "-c", cmd, (void *)NULL); + execle("/bin/sh", "sh", "-c", cmd, (void *)NULL, child_envp); sway_log_errno(SWAY_ERROR, "execlp failed"); _exit(1); }