mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Reset scrolling region on exit.
This commit is contained in:
		
							
								
								
									
										11
									
								
								local.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								local.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: local.c,v 1.12 2007-10-01 14:18:42 nicm Exp $ */
 | 
					/* $Id: local.c,v 1.13 2007-10-02 15:13:59 nicm Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <sys/types.h>
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					#include <sys/ioctl.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <curses.h>
 | 
					#include <curses.h>
 | 
				
			||||||
#include <fcntl.h>
 | 
					#include <fcntl.h>
 | 
				
			||||||
@@ -288,6 +289,8 @@ local_cmp(const void *ptr1, const void *ptr2)
 | 
				
			|||||||
void
 | 
					void
 | 
				
			||||||
local_done(void)
 | 
					local_done(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct winsize	ws;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xfree(local_in);
 | 
						xfree(local_in);
 | 
				
			||||||
	xfree(local_out);
 | 
						xfree(local_out);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -295,6 +298,12 @@ local_done(void)
 | 
				
			|||||||
		fatal("tcsetattr failed");
 | 
							fatal("tcsetattr failed");
 | 
				
			||||||
	close(local_fd);
 | 
						close(local_fd);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						if (change_scroll_region != NULL) {
 | 
				
			||||||
 | 
							if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1)
 | 
				
			||||||
 | 
								fatal("ioctl(TIOCGWINSZ)");
 | 
				
			||||||
 | 
							putp(tparm(change_scroll_region, 0, ws.ws_row - 1));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (keypad_local != NULL)
 | 
						if (keypad_local != NULL)
 | 
				
			||||||
		putp(keypad_local);	/* not local_putp */
 | 
							putp(keypad_local);	/* not local_putp */
 | 
				
			||||||
	if (exit_ca_mode != NULL)
 | 
						if (exit_ca_mode != NULL)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user