=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.432 retrieving revision 1.433 diff -c -r1.432 -r1.433 *** src/usr.bin/tmux/tty.c 2023/07/13 06:03:48 1.432 --- src/usr.bin/tmux/tty.c 2023/09/02 09:17:23 1.433 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.432 2023/07/13 06:03:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.433 2023/09/02 09:17:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 2814,2824 **** gc->us = c; } ! /* Underscore colour is set as RGB so convert. */ ! if ((c = colour_force_rgb (gc->us)) == -1) ! gc->us = 8; ! else ! gc->us = c; } static void --- 2814,2826 ---- gc->us = c; } ! /* Convert underscore colour if only RGB can be supported. */ ! if (!tty_term_has(tty->term, TTYC_SETULC1)) { ! if ((c = colour_force_rgb (gc->us)) == -1) ! gc->us = 8; ! else ! gc->us = c; ! } } static void *************** *** 2898,2906 **** goto save; } ! /* Must be an RGB colour - this should never happen. */ ! if (~gc->us & COLOUR_FLAG_RGB) return; /* * Setulc and setal follows the ncurses(3) one argument "direct colour" --- 2900,2916 ---- goto save; } ! /* ! * If this is not an RGB colour, use Setulc1 if it exists, otherwise ! * convert. ! */ ! if (~gc->us & COLOUR_FLAG_RGB) { ! c = gc->us; ! if ((~c & COLOUR_FLAG_256) && (c >= 90 && c <= 97)) ! c -= 82; ! tty_putcode_i(tty, TTYC_SETULC1, c & ~COLOUR_FLAG_256); return; + } /* * Setulc and setal follows the ncurses(3) one argument "direct colour"