=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.230 retrieving revision 1.231 diff -c -r1.230 -r1.231 *** src/usr.bin/tmux/tty.c 2017/02/07 14:33:37 1.230 --- src/usr.bin/tmux/tty.c 2017/02/07 17:13:28 1.231 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.230 2017/02/07 14:33:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.231 2017/02/07 17:13:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 445,450 **** --- 445,451 ---- if (tty_log_fd != -1) write(tty_log_fd, s, strlen(s)); + log_debug("%s: %s", tty->path, s); } void *************** *** 454,465 **** if (tty->cell.attr & GRID_ATTR_CHARSET) { acs = tty_acs_get(tty, ch); ! if (acs != NULL) bufferevent_write(tty->event, acs, strlen(acs)); ! else bufferevent_write(tty->event, &ch, 1); ! } else bufferevent_write(tty->event, &ch, 1); if (ch >= 0x20 && ch != 0x7f) { if (tty->cx >= tty->sx) { --- 455,471 ---- if (tty->cell.attr & GRID_ATTR_CHARSET) { acs = tty_acs_get(tty, ch); ! if (acs != NULL) { bufferevent_write(tty->event, acs, strlen(acs)); ! log_debug("%s: %s", tty->path, acs); ! } else { bufferevent_write(tty->event, &ch, 1); ! log_debug("%s: %c", tty->path, ch); ! } ! } else { bufferevent_write(tty->event, &ch, 1); + log_debug("%s: %c", tty->path, ch); + } if (ch >= 0x20 && ch != 0x7f) { if (tty->cx >= tty->sx) { *************** *** 486,493 **** --- 492,502 ---- tty_putn(struct tty *tty, const void *buf, size_t len, u_int width) { bufferevent_write(tty->event, buf, len); + if (tty_log_fd != -1) write(tty_log_fd, buf, len); + log_debug("%s: %.*s", tty->path, (int)len, (char *)buf); + tty->cx += width; } *************** *** 1319,1325 **** tty_cursor(tty, 0, tty->cy); tty_putcode2(tty, TTYC_CSR, tty->rupper, tty->rlower); ! tty_cursor(tty, 0, 0); } /* Turn off margin. */ --- 1328,1334 ---- tty_cursor(tty, 0, tty->cy); tty_putcode2(tty, TTYC_CSR, tty->rupper, tty->rlower); ! tty->cx = tty->cy = 0; } /* Turn off margin. */ *************** *** 1347,1358 **** if (tty->rleft == rleft && tty->rright == rright) return; tty->rleft = rleft; tty->rright = rright; ! snprintf(s, sizeof s, "\033[%u;%us", rleft + 1, rright + 1); tty_puts(tty, s); ! tty_cursor(tty, 0, 0); } /* Move cursor inside pane. */ --- 1356,1370 ---- if (tty->rleft == rleft && tty->rright == rright) return; + tty->rupper = 0; + tty->rlower = tty->sy - 1; + tty->rleft = rleft; tty->rright = rright; ! snprintf(s, sizeof s, "\033[r\033[%u;%us", rleft + 1, rright + 1); tty_puts(tty, s); ! tty->cx = tty->cy = 0; } /* Move cursor inside pane. */