=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.284 retrieving revision 1.285 diff -u -r1.284 -r1.285 --- src/usr.bin/tmux/tty.c 2017/05/15 07:54:44 1.284 +++ src/usr.bin/tmux/tty.c 2017/05/15 16:44:04 1.285 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.284 2017/05/15 07:54:44 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.285 2017/05/15 16:44:04 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -71,8 +71,6 @@ static void tty_default_attributes(struct tty *, const struct window_pane *, u_int); -#define tty_use_acs(tty) \ - (tty_term_has((tty)->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8)) #define tty_use_margin(tty) \ ((tty)->term_type == TTY_VT420) @@ -278,7 +276,8 @@ void tty_start_tty(struct tty *tty) { - struct termios tio; + struct client *c = tty->client; + struct termios tio; if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) { setblocking(tty->fd, 0); @@ -299,10 +298,14 @@ tty_putcode(tty, TTYC_SMCUP); tty_putcode(tty, TTYC_SMKX); - if (tty_use_acs(tty)) - tty_putcode(tty, TTYC_ENACS); tty_putcode(tty, TTYC_CLEAR); + if (tty_acs_needed(tty)) { + log_debug("%s: using capabilities for ACS", c->name); + tty_putcode(tty, TTYC_ENACS); + } else + log_debug("%s: using UTF-8 for ACS", c->name); + tty_putcode(tty, TTYC_CNORM); if (tty_term_has(tty->term, TTYC_KMOUS)) tty_puts(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l"); @@ -351,7 +354,7 @@ return; tty_raw(tty, tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1)); - if (tty_use_acs(tty)) + if (tty_acs_needed(tty)) tty_raw(tty, tty_term_string(tty->term, TTYC_RMACS)); tty_raw(tty, tty_term_string(tty->term, TTYC_SGR0)); tty_raw(tty, tty_term_string(tty->term, TTYC_RMKX)); @@ -1417,7 +1420,7 @@ struct grid_cell *gc = &tty->cell; if (!grid_cells_equal(gc, &grid_default_cell)) { - if ((gc->attr & GRID_ATTR_CHARSET) && tty_use_acs(tty)) + if ((gc->attr & GRID_ATTR_CHARSET) && tty_acs_needed(tty)) tty_putcode(tty, TTYC_RMACS); tty_putcode(tty, TTYC_SGR0); memcpy(gc, &grid_default_cell, sizeof *gc); @@ -1767,7 +1770,7 @@ tty_putcode(tty, TTYC_INVIS); if (changed & GRID_ATTR_STRIKETHROUGH) tty_putcode(tty, TTYC_SMXX); - if ((changed & GRID_ATTR_CHARSET) && tty_use_acs(tty)) + if ((changed & GRID_ATTR_CHARSET) && tty_acs_needed(tty)) tty_putcode(tty, TTYC_SMACS); }