mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Don't set the terminal to nonblocking on detach until we have finished with it
entirely.
This commit is contained in:
		
							
								
								
									
										7
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tty.c
									
									
									
									
									
								
							@@ -213,10 +213,6 @@ tty_stop_tty(struct tty *tty)
 | 
				
			|||||||
	 * because the fd is invalid. Things like ssh -t can easily leave us
 | 
						 * because the fd is invalid. Things like ssh -t can easily leave us
 | 
				
			||||||
	 * with a dead tty.
 | 
						 * with a dead tty.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if ((mode = fcntl(tty->fd, F_GETFL)) == -1)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	if (fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK) == -1)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1)
 | 
						if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1)
 | 
						if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1)
 | 
				
			||||||
@@ -233,6 +229,9 @@ tty_stop_tty(struct tty *tty)
 | 
				
			|||||||
		tty_raw(tty, "\033[?1000l");
 | 
							tty_raw(tty, "\033[?1000l");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
 | 
						tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((mode = fcntl(tty->fd, F_GETFL)) != -1)
 | 
				
			||||||
 | 
							fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user