diff options
author | 2011-04-09 07:48:08 +0000 | |
---|---|---|
committer | 2011-04-09 07:48:08 +0000 | |
commit | 93ee3d524bee74c438fe446d5e09a6940a1bf76c (patch) | |
tree | 3539d5244a583abeeff1465c9d967a43b98fd119 | |
parent | use unique wait channels (diff) | |
download | wireguard-openbsd-93ee3d524bee74c438fe446d5e09a6940a1bf76c.tar.xz wireguard-openbsd-93ee3d524bee74c438fe446d5e09a6940a1bf76c.zip |
If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 | ||||
-rw-r--r-- | usr.bin/tmux/tty-term.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 9 |
3 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 5f0f6f02bed..daa5dab9bc2 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.279 2011/04/06 21:51:31 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.280 2011/04/09 07:48:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c index 44da095c264..2073d2e4f09 100644 --- a/usr.bin/tmux/tty-term.c +++ b/usr.bin/tmux/tty-term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-term.c,v 1.20 2011/01/26 00:11:47 nicm Exp $ */ +/* $OpenBSD: tty-term.c,v 1.21 2011/04/09 07:48:08 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 239cc87d2fa..d26af944bd6 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.103 2011/03/27 20:36:19 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.104 2011/04/09 07:48:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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) |