aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-04-09 07:48:08 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-04-09 07:48:08 +0000
commit0a09d04e1b63f816fb2bf16570ef63418349a4bf (patch)
tree3345f3536a8f5a3c171ea85dfda4f4c58a7ba493
parentec89eb955236f91e63febe1764123e605641fc52 (diff)
downloadrtmux-0a09d04e1b63f816fb2bf16570ef63418349a4bf.tar.gz
rtmux-0a09d04e1b63f816fb2bf16570ef63418349a4bf.tar.bz2
rtmux-0a09d04e1b63f816fb2bf16570ef63418349a4bf.zip
If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
-rw-r--r--tmux.h1
-rw-r--r--tty-term.c1
-rw-r--r--tty.c7
3 files changed, 8 insertions, 1 deletions
diff --git a/tmux.h b/tmux.h
index 12f68085..36dcf273 100644
--- a/tmux.h
+++ b/tmux.h
@@ -323,6 +323,7 @@ enum tty_code_code {
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 --git a/tty-term.c b/tty-term.c
index 943f1e4d..59a1bbba 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -178,6 +178,7 @@ const struct tty_term_code_entry tty_term_codes[NTTYCODE] = {
{ 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" },
};
diff --git a/tty.c b/tty.c
index bffb1f93..73dff0be 100644
--- a/tty.c
+++ b/tty.c
@@ -1218,7 +1218,12 @@ tty_attributes(struct tty *tty, const struct grid_cell *gc)
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)