mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Defer reading from control client until the command line command has
completed.
This commit is contained in:
		@@ -776,7 +776,6 @@ control_start(struct client *c)
 | 
			
		||||
 | 
			
		||||
	cs->read_event = bufferevent_new(c->fd, control_read_callback,
 | 
			
		||||
	    control_write_callback, control_error_callback, c);
 | 
			
		||||
	bufferevent_enable(cs->read_event, EV_READ);
 | 
			
		||||
 | 
			
		||||
	if (c->flags & CLIENT_CONTROLCONTROL)
 | 
			
		||||
		cs->write_event = cs->read_event;
 | 
			
		||||
@@ -793,6 +792,13 @@ control_start(struct client *c)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Control client ready. */
 | 
			
		||||
void
 | 
			
		||||
control_ready(struct client *c)
 | 
			
		||||
{
 | 
			
		||||
	bufferevent_enable(c->control_state->read_event, EV_READ);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Discard all output for a client. */
 | 
			
		||||
void
 | 
			
		||||
control_discard(struct client *c)
 | 
			
		||||
 
 | 
			
		||||
@@ -2791,8 +2791,11 @@ server_client_command_done(struct cmdq_item *item, __unused void *data)
 | 
			
		||||
 | 
			
		||||
	if (~c->flags & CLIENT_ATTACHED)
 | 
			
		||||
		c->flags |= CLIENT_EXIT;
 | 
			
		||||
	else if (~c->flags & CLIENT_EXIT)
 | 
			
		||||
	else if (~c->flags & CLIENT_EXIT) {
 | 
			
		||||
		if (c->flags & CLIENT_CONTROL)
 | 
			
		||||
			control_ready(c);
 | 
			
		||||
		tty_send_requests(&c->tty);
 | 
			
		||||
	}
 | 
			
		||||
	return (CMD_RETURN_NORMAL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -3134,6 +3134,7 @@ char	*parse_window_name(const char *);
 | 
			
		||||
/* control.c */
 | 
			
		||||
void	control_discard(struct client *);
 | 
			
		||||
void	control_start(struct client *);
 | 
			
		||||
void	control_ready(struct client *);
 | 
			
		||||
void	control_stop(struct client *);
 | 
			
		||||
void	control_set_pane_on(struct client *, struct window_pane *);
 | 
			
		||||
void	control_set_pane_off(struct client *, struct window_pane *);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user