mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		@@ -106,8 +106,7 @@ const struct options_table_entry server_options_table[] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	{ .name = "terminal-overrides",
 | 
						{ .name = "terminal-overrides",
 | 
				
			||||||
	  .type = OPTIONS_TABLE_STRING,
 | 
						  .type = OPTIONS_TABLE_STRING,
 | 
				
			||||||
	  .default_str = "*256col*:colors=256"
 | 
						  .default_str = "xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
 | 
				
			||||||
	                 ",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
 | 
					 | 
				
			||||||
	                 ":Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
 | 
						                 ":Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
 | 
				
			||||||
			 ":Ss=\\E[%p1%d q:Se=\\E[2 q,screen*:XT"
 | 
								 ":Ss=\\E[%p1%d q:Se=\\E[2 q,screen*:XT"
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										23
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								tty.c
									
									
									
									
									
								
							@@ -1648,14 +1648,19 @@ tty_try_256(struct tty *tty, u_char colour, const char *type)
 | 
				
			|||||||
	char	s[32];
 | 
						char	s[32];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * If the terminfo entry has 256 colours, assume that setaf and setab
 | 
						 * If the terminfo entry has 256 colours and setaf and setab exist,
 | 
				
			||||||
	 * work correctly.
 | 
						 * assume that they work correctly.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (tty->term->flags & TERM_256COLOURS) {
 | 
						if (tty->term->flags & TERM_256COLOURS) {
 | 
				
			||||||
		if (*type == '3')
 | 
							if (*type == '3') {
 | 
				
			||||||
 | 
								if (!tty_term_has(tty->term, TTYC_SETAF))
 | 
				
			||||||
 | 
									goto fallback;
 | 
				
			||||||
			tty_putcode1(tty, TTYC_SETAF, colour);
 | 
								tty_putcode1(tty, TTYC_SETAF, colour);
 | 
				
			||||||
		else
 | 
							} else {
 | 
				
			||||||
 | 
								if (!tty_term_has(tty->term, TTYC_SETAB))
 | 
				
			||||||
 | 
									goto fallback;
 | 
				
			||||||
			tty_putcode1(tty, TTYC_SETAB, colour);
 | 
								tty_putcode1(tty, TTYC_SETAB, colour);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return (0);
 | 
							return (0);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1663,13 +1668,15 @@ tty_try_256(struct tty *tty, u_char colour, const char *type)
 | 
				
			|||||||
	 * If the user has specified -2 to the client, setaf and setab may not
 | 
						 * If the user has specified -2 to the client, setaf and setab may not
 | 
				
			||||||
	 * work, so send the usual sequence.
 | 
						 * work, so send the usual sequence.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (tty->term_flags & TERM_256COLOURS) {
 | 
						if (tty->term_flags & TERM_256COLOURS)
 | 
				
			||||||
 | 
							goto fallback;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return (-1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fallback:
 | 
				
			||||||
	xsnprintf(s, sizeof s, "\033[%s;5;%hhum", type, colour);
 | 
						xsnprintf(s, sizeof s, "\033[%s;5;%hhum", type, colour);
 | 
				
			||||||
	tty_puts(tty, s);
 | 
						tty_puts(tty, s);
 | 
				
			||||||
	return (0);
 | 
						return (0);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return (-1);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user