mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	If mouse bits change, clear them all and set again to avoid problems
with some bits implying others. GitHub issue 2458.
This commit is contained in:
		
							
								
								
									
										26
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								tty.c
									
									
									
									
									
								
							@@ -694,28 +694,26 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	if ((changed & ALL_MOUSE_MODES) &&
 | 
						if ((changed & ALL_MOUSE_MODES) &&
 | 
				
			||||||
	    tty_term_has(tty->term, TTYC_KMOUS)) {
 | 
						    tty_term_has(tty->term, TTYC_KMOUS)) {
 | 
				
			||||||
		if ((mode & ALL_MOUSE_MODES) == 0)
 | 
							/*
 | 
				
			||||||
 | 
							 * If the mouse modes have changed, clear any that are set and
 | 
				
			||||||
 | 
							 * apply again. There are differences in how terminals track
 | 
				
			||||||
 | 
							 * the various bits.
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
 | 
							if (tty->mode & MODE_MOUSE_SGR)
 | 
				
			||||||
			tty_puts(tty, "\033[?1006l");
 | 
								tty_puts(tty, "\033[?1006l");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_STANDARD) &&
 | 
							if (tty->mode & MODE_MOUSE_STANDARD)
 | 
				
			||||||
		    (~mode & MODE_MOUSE_STANDARD))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1000l");
 | 
								tty_puts(tty, "\033[?1000l");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_BUTTON) &&
 | 
							if (tty->mode & MODE_MOUSE_BUTTON)
 | 
				
			||||||
		    (~mode & MODE_MOUSE_BUTTON))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1002l");
 | 
								tty_puts(tty, "\033[?1002l");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_ALL) &&
 | 
							if (tty->mode & MODE_MOUSE_ALL)
 | 
				
			||||||
		    (~mode & MODE_MOUSE_ALL))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1003l");
 | 
								tty_puts(tty, "\033[?1003l");
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (mode & ALL_MOUSE_MODES)
 | 
							if (mode & ALL_MOUSE_MODES)
 | 
				
			||||||
			tty_puts(tty, "\033[?1006h");
 | 
								tty_puts(tty, "\033[?1006h");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_STANDARD) &&
 | 
							if (mode & MODE_MOUSE_STANDARD)
 | 
				
			||||||
		    (mode & MODE_MOUSE_STANDARD))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1000h");
 | 
								tty_puts(tty, "\033[?1000h");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_BUTTON) &&
 | 
							if (mode & MODE_MOUSE_BUTTON)
 | 
				
			||||||
		    (mode & MODE_MOUSE_BUTTON))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1002h");
 | 
								tty_puts(tty, "\033[?1002h");
 | 
				
			||||||
		if ((changed & MODE_MOUSE_ALL) &&
 | 
							if (mode & MODE_MOUSE_ALL)
 | 
				
			||||||
		    (mode & MODE_MOUSE_ALL))
 | 
					 | 
				
			||||||
			tty_puts(tty, "\033[?1003h");
 | 
								tty_puts(tty, "\033[?1003h");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (changed & MODE_BRACKETPASTE) {
 | 
						if (changed & MODE_BRACKETPASTE) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user