On Friday, 2011-04-08, at 23:46:38 +0100, Nicholas Marriott wrote:
> I think it would be better if this only uses sitm if it exists and
> uses smso if it does not.

I have no idea why I didn't think of this the first time. I have urxvt
and the console displaying the same session right now, urxvt showing
italics, the console showing reverse. If you're not in an
italics-capable terminal, you can't even tell something's changed.
Brilliant.
diff -Ndur tmux-orig/tmux.h tmux/tmux.h
--- tmux-orig/tmux.h    2011-04-06 19:29:26.000000000 -0300
+++ tmux/tmux.h 2011-04-08 13:46:19.144714718 -0300
@@ -319,6 +319,7 @@
        TTYC_SMKX,      /* keypad_xmit, ks */
        TTYC_SMSO,      /* enter_standout_mode, so */
        TTYC_SMUL,      /* enter_underline_mode, us */
+       TTYC_SITM,      /* enter_italics_mode, it */
        TTYC_VPA,       /* row_address, cv */
        TTYC_XENL,      /* eat_newline_glitch, xn */
 };
diff -Ndur tmux-orig/tty.c tmux/tty.c
--- tmux-orig/tty.c     2011-04-06 19:18:05.000000000 -0300
+++ tmux/tty.c  2011-04-08 22:23:15.988429848 -0300
@@ -1218,7 +1218,10 @@
        if (changed & GRID_ATTR_DIM)
                tty_putcode(tty, TTYC_DIM);
        if (changed & GRID_ATTR_ITALICS)
-               tty_putcode(tty, TTYC_SMSO);
+               if (tty_term_has(tty->term, TTYC_SITM))
+                       tty_putcode(tty, TTYC_SITM);
+               else
+                       tty_putcode(tty, TTYC_SMSO);
        if (changed & GRID_ATTR_UNDERSCORE)
                tty_putcode(tty, TTYC_SMUL);
        if (changed & GRID_ATTR_BLINK)
diff -Ndur tmux-orig/tty-term.c tmux/tty-term.c
--- tmux-orig/tty-term.c        2011-02-15 13:12:28.000000000 -0200
+++ tmux/tty-term.c     2011-04-08 13:46:19.144714718 -0300
@@ -181,6 +181,7 @@
        { TTYC_SMKX, TTYCODE_STRING, "smkx" },
        { TTYC_SMSO, TTYCODE_STRING, "smso" },
        { TTYC_SMUL, TTYCODE_STRING, "smul" },
+       { TTYC_SITM, TTYCODE_STRING, "sitm" },
        { TTYC_VPA, TTYCODE_STRING, "vpa" },
        { TTYC_XENL, TTYCODE_FLAG, "xenl" },
 };
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to