-/* $OpenBSD: job.c,v 1.68 2024/05/15 09:59:12 nicm Exp $ */
+/* $OpenBSD: job.c,v 1.69 2024/09/30 07:54:51 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
/* Start a job running. */
struct job *
-job_run(const char *cmd, int argc, char **argv, struct environ *e, struct session *s,
- const char *cwd, job_update_cb updatecb, job_complete_cb completecb,
- job_free_cb freecb, void *data, int flags, int sx, int sy)
+job_run(const char *cmd, int argc, char **argv, struct environ *e,
+ struct session *s, const char *cwd, job_update_cb updatecb,
+ job_complete_cb completecb, job_free_cb freecb, void *data, int flags,
+ int sx, int sy)
{
struct job *job;
struct environ *env;
sigset_t set, oldset;
struct winsize ws;
char **argvp, tty[TTY_NAME_MAX], *argv0;
+ struct options *oo;
/*
* Do not set TERM during .tmux.conf (second argument here), it is nice
if (e != NULL)
environ_copy(e, env);
- if (s != NULL)
- shell = options_get_string(s->options, "default-shell");
- else
- shell = options_get_string(global_s_options, "default-shell");
- if (!checkshell(shell))
+ if (~flags & JOB_DEFAULTSHELL)
shell = _PATH_BSHELL;
+ else {
+ if (s != NULL)
+ oo = s->options;
+ else
+ oo = global_s_options;
+ shell = options_get_string(oo, "default-shell");
+ if (!checkshell(shell))
+ shell = _PATH_BSHELL;
+ }
argv0 = shell_argv0(shell, 0);
sigfillset(&set);
-/* $OpenBSD: popup.c,v 1.54 2024/08/21 04:17:09 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.55 2024/09/30 07:54:51 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
pd->job = job_run(shellcmd, argc, argv, env, s, cwd,
popup_job_update_cb, popup_job_complete_cb, NULL, pd,
- JOB_NOWAIT|JOB_PTY|JOB_KEEPWRITE, jx, jy);
+ JOB_NOWAIT|JOB_PTY|JOB_KEEPWRITE|JOB_DEFAULTSHELL, jx, jy);
pd->ictx = input_init(NULL, job_get_event(pd->job), &pd->palette);
server_client_set_overlay(c, 0, popup_check_cb, popup_mode_cb,
-/* $OpenBSD: tmux.h,v 1.1227 2024/09/16 20:28:22 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1228 2024/09/30 07:54:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
#define JOB_NOWAIT 0x1
#define JOB_KEEPWRITE 0x2
#define JOB_PTY 0x4
+#define JOB_DEFAULTSHELL 0x8
struct job *job_run(const char *, int, char **, struct environ *,
struct session *, const char *, job_update_cb,
job_complete_cb, job_free_cb, void *, int, int, int);