mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Only use default-shell for popups, return to /bin/sh for run-shell,
if-shell and #() - these have been documented as using /bin/sh for a long time and scripts rely on it. Pointed out by Gregory Pakosz.
This commit is contained in:
		
							
								
								
									
										23
									
								
								job.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								job.c
									
									
									
									
									
								
							@@ -71,9 +71,10 @@ static LIST_HEAD(joblist, job) all_jobs = LIST_HEAD_INITIALIZER(all_jobs);
 | 
			
		||||
 | 
			
		||||
/* 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;
 | 
			
		||||
@@ -83,6 +84,7 @@ job_run(const char *cmd, int argc, char **argv, struct environ *e, struct sessio
 | 
			
		||||
	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
 | 
			
		||||
@@ -93,12 +95,17 @@ job_run(const char *cmd, int argc, char **argv, struct environ *e, struct sessio
 | 
			
		||||
	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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user