mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +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:
		
							
								
								
									
										7
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tty.c
									
									
									
									
									
								
							@@ -154,16 +154,21 @@ tty_read_callback(__unused int fd, __unused short events, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct tty	*tty = data;
 | 
			
		||||
	struct client	*c = tty->client;
 | 
			
		||||
	const char	*name = c->name;
 | 
			
		||||
	size_t		 size = EVBUFFER_LENGTH(tty->in);
 | 
			
		||||
	int		 nread;
 | 
			
		||||
 | 
			
		||||
	nread = evbuffer_read(tty->in, tty->fd, -1);
 | 
			
		||||
	if (nread == 0 || nread == -1) {
 | 
			
		||||
		if (nread == 0)
 | 
			
		||||
			log_debug("%s: read closed", name);
 | 
			
		||||
		else
 | 
			
		||||
			log_debug("%s: read error: %s", name, strerror(errno));
 | 
			
		||||
		event_del(&tty->event_in);
 | 
			
		||||
		server_client_lost(tty->client);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	log_debug("%s: read %d bytes (already %zu)", c->name, nread, size);
 | 
			
		||||
	log_debug("%s: read %d bytes (already %zu)", name, nread, size);
 | 
			
		||||
 | 
			
		||||
	while (tty_keys_next(tty))
 | 
			
		||||
		;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user