mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Clear PANE_EXITED flag when starting new child process in case the pane
has been respawned.
This commit is contained in:
		@@ -158,7 +158,10 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		close(pipe_fd[1]);
 | 
							close(pipe_fd[1]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		wp->pipe_fd = pipe_fd[0];
 | 
							wp->pipe_fd = pipe_fd[0];
 | 
				
			||||||
		wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
 | 
							if (wp->fd != -1)
 | 
				
			||||||
 | 
								wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								wp->pipe_off = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		setblocking(wp->pipe_fd, 0);
 | 
							setblocking(wp->pipe_fd, 0);
 | 
				
			||||||
		wp->pipe_event = bufferevent_new(wp->pipe_fd,
 | 
							wp->pipe_event = bufferevent_new(wp->pipe_fd,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -302,6 +302,7 @@ server_destroy_pane(struct window_pane *wp, int notify)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (wp->fd != -1) {
 | 
						if (wp->fd != -1) {
 | 
				
			||||||
		bufferevent_free(wp->event);
 | 
							bufferevent_free(wp->event);
 | 
				
			||||||
 | 
							wp->event = NULL;
 | 
				
			||||||
		close(wp->fd);
 | 
							close(wp->fd);
 | 
				
			||||||
		wp->fd = -1;
 | 
							wp->fd = -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								window.c
									
									
									
									
									
								
							@@ -921,6 +921,7 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
 | 
				
			|||||||
	sigprocmask(SIG_BLOCK, &set, &oldset);
 | 
						sigprocmask(SIG_BLOCK, &set, &oldset);
 | 
				
			||||||
	switch (wp->pid = fdforkpty(ptm_fd, &wp->fd, wp->tty, NULL, &ws)) {
 | 
						switch (wp->pid = fdforkpty(ptm_fd, &wp->fd, wp->tty, NULL, &ws)) {
 | 
				
			||||||
	case -1:
 | 
						case -1:
 | 
				
			||||||
 | 
							wp->event = NULL;
 | 
				
			||||||
		wp->fd = -1;
 | 
							wp->fd = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		xasprintf(cause, "%s: %s", cmd, strerror(errno));
 | 
							xasprintf(cause, "%s: %s", cmd, strerror(errno));
 | 
				
			||||||
@@ -1000,6 +1001,9 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
 | 
				
			|||||||
	if (wp->event == NULL)
 | 
						if (wp->event == NULL)
 | 
				
			||||||
		fatalx("out of memory");
 | 
							fatalx("out of memory");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						wp->pipe_off = 0;
 | 
				
			||||||
 | 
						wp->flags &= ~PANE_EXITED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bufferevent_setwatermark(wp->event, EV_READ, 0, READ_SIZE);
 | 
						bufferevent_setwatermark(wp->event, EV_READ, 0, READ_SIZE);
 | 
				
			||||||
	bufferevent_enable(wp->event, EV_READ|EV_WRITE);
 | 
						bufferevent_enable(wp->event, EV_READ|EV_WRITE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user