summaryrefslogtreecommitdiffstats
path: root/tty.c
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 /tty.c
parentec89eb955236f91e63febe1764123e605641fc52 (diff)
If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c7
1 files changed, 6 insertions, 1 deletions
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)