mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Don't die on any error from fd.
This commit is contained in:
		
							
								
								
									
										18
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								tty.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: tty.c,v 1.78 2009-02-16 19:01:16 nicm Exp $ */
 | 
			
		||||
/* $Id: tty.c,v 1.79 2009-02-17 18:53:10 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -187,15 +187,12 @@ tty_stop_tty(struct tty *tty)
 | 
			
		||||
	 * because the fd is invalid. Things like ssh -t can easily leave us
 | 
			
		||||
	 * with a dead tty.
 | 
			
		||||
	 */
 | 
			
		||||
	if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1) {
 | 
			
		||||
		if (errno != EBADF && errno != ENXIO && errno != ENOTTY)
 | 
			
		||||
			fatal("ioctl(TIOCGWINSZ)");
 | 
			
		||||
	} else if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1) {
 | 
			
		||||
		if (errno != EBADF && errno != ENXIO && errno != ENOTTY)
 | 
			
		||||
			fatal("tcsetattr failed");
 | 
			
		||||
	} else {
 | 
			
		||||
		tty_raw(tty,
 | 
			
		||||
		    tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1));
 | 
			
		||||
	if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1)
 | 
			
		||||
		return;
 | 
			
		||||
	if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	tty_raw(tty, tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1));
 | 
			
		||||
	tty_raw(tty, tty_term_string(tty->term, TTYC_RMACS));
 | 
			
		||||
	tty_raw(tty, tty_term_string(tty->term, TTYC_SGR0));
 | 
			
		||||
	tty_raw(tty, tty_term_string(tty->term, TTYC_CLEAR));
 | 
			
		||||
@@ -206,7 +203,6 @@ tty_stop_tty(struct tty *tty)
 | 
			
		||||
	if (tty_term_has(tty->term, TTYC_KMOUS))
 | 
			
		||||
		tty_raw(tty, "\033[?1000l");
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
tty_fill_acs(struct tty *tty)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user