mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:17:31 +00:00 
			
		
		
		
	Add a -D flag to ask tmux not to daemonize, useful both for running a debugger
(lldb does not have follow-fork-mode) and for running with a managed supervisor init system. GitHub issue 2190.
This commit is contained in:
		@@ -236,11 +236,22 @@ server_client_create(int fd)
 | 
			
		||||
int
 | 
			
		||||
server_client_open(struct client *c, char **cause)
 | 
			
		||||
{
 | 
			
		||||
	const char	*ttynam = _PATH_TTY;
 | 
			
		||||
 | 
			
		||||
	if (c->flags & CLIENT_CONTROL)
 | 
			
		||||
		return (0);
 | 
			
		||||
 | 
			
		||||
	if (strcmp(c->ttyname, "/dev/tty") == 0) {
 | 
			
		||||
		*cause = xstrdup("can't use /dev/tty");
 | 
			
		||||
	if (strcmp(c->ttyname, ttynam) ||
 | 
			
		||||
	    ((isatty(STDIN_FILENO) &&
 | 
			
		||||
	    (ttynam = ttyname(STDIN_FILENO)) != NULL &&
 | 
			
		||||
	    strcmp(c->ttyname, ttynam) == 0) ||
 | 
			
		||||
	    (isatty(STDOUT_FILENO) &&
 | 
			
		||||
	    (ttynam = ttyname(STDOUT_FILENO)) != NULL &&
 | 
			
		||||
	    strcmp(c->ttyname, ttynam) == 0) ||
 | 
			
		||||
	    (isatty(STDERR_FILENO) &&
 | 
			
		||||
	    (ttynam = ttyname(STDERR_FILENO)) != NULL &&
 | 
			
		||||
	    strcmp(c->ttyname, ttynam) == 0))) {
 | 
			
		||||
		xasprintf(cause, "can't use %s", c->ttyname);
 | 
			
		||||
		return (-1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user