mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Look for feature code 21 for DECSLRM and 28 for DECFRA in the device
attributes and also accept level 1 (there is no hardware with this but some emulators may use it). Pointed out by James Holderness.
This commit is contained in:
		
							
								
								
									
										24
									
								
								tty-keys.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								tty-keys.c
									
									
									
									
									
								
							@@ -1314,26 +1314,21 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Add terminal features. Hardware level 5 does not offer SIXEL but
 | 
			
		||||
	 * some terminal emulators report it anyway and it does not harm
 | 
			
		||||
	 * to check it here.
 | 
			
		||||
	 *
 | 
			
		||||
	 * DECSLRM and DECFRA should be supported by level 5 as well as level
 | 
			
		||||
	 * 4, but VTE has rather ruined it by advertising level 5 despite not
 | 
			
		||||
	 * supporting them.
 | 
			
		||||
	 */
 | 
			
		||||
	/* Add terminal features. */
 | 
			
		||||
	switch (p[0]) {
 | 
			
		||||
	case 64: /* level 4 */
 | 
			
		||||
		tty_add_features(features, "margins,rectfill", ",");
 | 
			
		||||
		/* FALLTHROUGH */
 | 
			
		||||
	case 61: /* level 1 */
 | 
			
		||||
	case 62: /* level 2 */
 | 
			
		||||
	case 63: /* level 3 */
 | 
			
		||||
	case 64: /* level 4 */
 | 
			
		||||
	case 65: /* level 5 */
 | 
			
		||||
		for (i = 1; i < n; i++) {
 | 
			
		||||
			log_debug("%s: DA feature: %d", c->name, p[i]);
 | 
			
		||||
			if (p[i] == 4)
 | 
			
		||||
				tty_add_features(features, "sixel", ",");
 | 
			
		||||
			if (p[i] == 21)
 | 
			
		||||
				tty_add_features(features, "margins", ",");
 | 
			
		||||
			if (p[i] == 28)
 | 
			
		||||
				tty_add_features(features, "rectfill", ",");
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1405,11 +1400,6 @@ tty_keys_device_attributes2(struct tty *tty, const char *buf, size_t len,
 | 
			
		||||
	 * we can't use level 5 from DA because of VTE.
 | 
			
		||||
	 */
 | 
			
		||||
	switch (p[0]) {
 | 
			
		||||
	case 41: /* VT420 */
 | 
			
		||||
	case 61: /* VT510 */
 | 
			
		||||
	case 64: /* VT520 */
 | 
			
		||||
		tty_add_features(features, "margins,rectfill", ",");
 | 
			
		||||
		break;
 | 
			
		||||
	case 'M': /* mintty */
 | 
			
		||||
		tty_default_features(features, "mintty", 0);
 | 
			
		||||
		break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user