I don't understand what this change is meant to do. We should send SITM for italics if the terminal supports it, unless we are emulating screen in which case we send SMSO. That is what it does at the moment and it's likely that even now changing it will make a horde of people appear to complain that less is suddenly showing italics. Anyone who wants the right (non-screen-bug-compatible behaviour) should have default-terminal set to tmux or tmux-256color (which is now the default anyway).
On Sat, 3 May 2025 at 20:03, Johannes Altmanninger <aclo...@gmail.com> wrote: > (this is an experimental patch, mainly for demonstration. I haven't done > much research). > > > https://www.gnu.org/software/termutils/manual/termcap-1.3/html_node/termcap_33.html > presents a reason for using standout mode: > > > Programs that use appearance modes only to highlight some text generally > > use the standout mode so that they can work on as many terminals as > possible. > > This is a nice idea, though it seems a bit dated. I'm not sure how many > applications really want to use this indirection. > > Most software terminals seem support both italics and reverse mode. > Most terminals interpret standout mode as reverse mode. > The exception is GNU screen where it means italics. > > According to the terminfo database on my system, terminals that do not > support italics mode (sitm) include > - Putty > - linux > - Emacs ansi-term (TERM=eterm) > --- > tty.c | 22 ++++++++-------------- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff --git a/tty.c b/tty.c > index 19e55757..680a0961 100644 > --- a/tty.c > +++ b/tty.c > @@ -684,16 +684,14 @@ tty_putn(struct tty *tty, const void *buf, size_t > len, u_int width) > static void > tty_set_italics(struct tty *tty) > { > - const char *s; > + const char *s = options_get_string(global_options, > "default-terminal");; > > - if (tty_term_has(tty->term, TTYC_SITM)) { > - s = options_get_string(global_options, "default-terminal"); > - if (strcmp(s, "screen") != 0 && strncmp(s, "screen-", 7) > != 0) { > - tty_putcode(tty, TTYC_SITM); > - return; > - } > + if (strcmp(s, "screen") == 0 && strncmp(s, "screen-", 7) == 0) { > + tty_putcode(tty, TTYC_SMSO); > + return; > } > - tty_putcode(tty, TTYC_SMSO); > + > + tty_putcode(tty, TTYC_SITM); > } > > void > @@ -2769,12 +2767,8 @@ tty_attributes(struct tty *tty, const struct > grid_cell *gc, > } > if (changed & GRID_ATTR_BLINK) > tty_putcode(tty, TTYC_BLINK); > - if (changed & GRID_ATTR_REVERSE) { > - if (tty_term_has(tty->term, TTYC_REV)) > - tty_putcode(tty, TTYC_REV); > - else if (tty_term_has(tty->term, TTYC_SMSO)) > - tty_putcode(tty, TTYC_SMSO); > - } > + if (changed & GRID_ATTR_REVERSE) > + tty_putcode(tty, TTYC_REV); > if (changed & GRID_ATTR_HIDDEN) > tty_putcode(tty, TTYC_INVIS); > if (changed & GRID_ATTR_STRIKETHROUGH) > -- > 2.49.0 > > -- > You received this message because you are subscribed to the Google Groups > "tmux-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tmux-users+unsubscr...@googlegroups.com. > To view this discussion, visit > https://groups.google.com/d/msgid/tmux-users/20250503190316.409246-3-aclopte%40gmail.com > . > -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscr...@googlegroups.com. To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/CAEdLfcFThy_VXPP1sAFbrexRhgZWoyQmn%3DOND%2BT3%3D5injDFwtw%40mail.gmail.com.