mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										11
									
								
								tty-keys.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								tty-keys.c
									
									
									
									
									
								
							@@ -1192,7 +1192,10 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
 | 
			
		||||
	if (tty->flags & TTY_HAVEDA)
 | 
			
		||||
		return (-1);
 | 
			
		||||
 | 
			
		||||
	/* First three bytes are always \033[?. */
 | 
			
		||||
	/*
 | 
			
		||||
	 * First three bytes are always \033[>. Some older Terminal.app
 | 
			
		||||
	 * versions respond as for DA (\033[?) so accept and ignore that.
 | 
			
		||||
	 */
 | 
			
		||||
	if (buf[0] != '\033')
 | 
			
		||||
		return (-1);
 | 
			
		||||
	if (len == 1)
 | 
			
		||||
@@ -1201,7 +1204,7 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
 | 
			
		||||
		return (-1);
 | 
			
		||||
	if (len == 2)
 | 
			
		||||
		return (1);
 | 
			
		||||
	if (buf[2] != '>')
 | 
			
		||||
	if (buf[2] != '>' && buf[2] != '?')
 | 
			
		||||
		return (-1);
 | 
			
		||||
	if (len == 3)
 | 
			
		||||
		return (1);
 | 
			
		||||
@@ -1219,6 +1222,10 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
 | 
			
		||||
	tmp[i] = '\0';
 | 
			
		||||
	*size = 4 + i;
 | 
			
		||||
 | 
			
		||||
	/* Ignore DA response. */
 | 
			
		||||
	if (buf[2] == '?')
 | 
			
		||||
		return (0);
 | 
			
		||||
 | 
			
		||||
	/* Convert all arguments to numbers. */
 | 
			
		||||
	cp = tmp;
 | 
			
		||||
	while ((next = strsep(&cp, ";")) != NULL) {
 | 
			
		||||
 
 | 
			
		||||
@@ -305,6 +305,8 @@ tty_term_strip(const char *s)
 | 
			
		||||
				ptr++;
 | 
			
		||||
			if (*ptr == '>')
 | 
			
		||||
				ptr++;
 | 
			
		||||
			if (*ptr == '\0')
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf[len++] = *ptr;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user