=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.131 retrieving revision 1.132 diff -c -r1.131 -r1.132 *** src/usr.bin/tmux/tty.c 2012/05/05 18:31:09 1.131 --- src/usr.bin/tmux/tty.c 2012/05/05 18:45:55 1.132 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.131 2012/05/05 18:31:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.132 2012/05/05 18:45:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 59,64 **** --- 59,67 ---- #define tty_use_rect(tty) \ ((tty)->xterm_version > 270) + #define tty_pane_full_width(tty, ctx) \ + ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx) + void tty_init(struct tty *tty, int fd, char *term) { *************** *** 781,790 **** void tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx) { ! struct window_pane *wp = ctx->wp; ! struct screen *s = wp->screen; ! ! if (ctx->xoff != 0 || screen_size_x(s) < tty->sx || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_IL1)) { tty_redraw_region(tty, ctx); --- 784,790 ---- void tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx) { ! if (!tty_pane_full_width(tty, ctx) || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_IL1)) { tty_redraw_region(tty, ctx); *************** *** 802,811 **** void tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx) { ! struct window_pane *wp = ctx->wp; ! struct screen *s = wp->screen; ! ! if (ctx->xoff != 0 || screen_size_x(s) < tty->sx || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_DL1)) { tty_redraw_region(tty, ctx); --- 802,808 ---- void tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx) { ! if (!tty_pane_full_width(tty, ctx) || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_DL1)) { tty_redraw_region(tty, ctx); *************** *** 831,838 **** tty_cursor_pane(tty, ctx, 0, ctx->ocy); ! if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx && ! tty_term_has(tty->term, TTYC_EL)) { tty_putcode(tty, TTYC_EL); } else { for (i = 0; i < screen_size_x(s); i++) --- 828,834 ---- tty_cursor_pane(tty, ctx, 0, ctx->ocy); ! if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) { tty_putcode(tty, TTYC_EL); } else { for (i = 0; i < screen_size_x(s); i++) *************** *** 851,858 **** tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); ! if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx && ! tty_term_has(tty->term, TTYC_EL)) tty_putcode(tty, TTYC_EL); else { for (i = ctx->ocx; i < screen_size_x(s); i++) --- 847,853 ---- tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); ! if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) tty_putcode(tty, TTYC_EL); else { for (i = ctx->ocx; i < screen_size_x(s); i++) *************** *** 880,892 **** void tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx) { - struct window_pane *wp = ctx->wp; - struct screen *s = wp->screen; - if (ctx->ocy != ctx->orupper) return; ! if (ctx->xoff != 0 || screen_size_x(s) < tty->sx || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_RI)) { tty_redraw_region(tty, ctx); --- 875,884 ---- void tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx) { if (ctx->ocy != ctx->orupper) return; ! if (!tty_pane_full_width(tty, ctx) || !tty_term_has(tty->term, TTYC_CSR) || !tty_term_has(tty->term, TTYC_RI)) { tty_redraw_region(tty, ctx); *************** *** 910,916 **** if (ctx->ocy != ctx->orlower) return; ! if (ctx->xoff != 0 || screen_size_x(s) < tty->sx || !tty_term_has(tty->term, TTYC_CSR)) { if (tty_large_region(tty, ctx)) wp->flags |= PANE_REDRAW; --- 902,908 ---- if (ctx->ocy != ctx->orlower) return; ! if (!tty_pane_full_width(tty, ctx) || !tty_term_has(tty->term, TTYC_CSR)) { if (tty_large_region(tty, ctx)) wp->flags |= PANE_REDRAW; *************** *** 952,959 **** tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); ! if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx && ! tty_term_has(tty->term, TTYC_EL)) { tty_putcode(tty, TTYC_EL); if (ctx->ocy != screen_size_y(s) - 1) { tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1); --- 944,950 ---- tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); ! if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) { tty_putcode(tty, TTYC_EL); if (ctx->ocy != screen_size_y(s) - 1) { tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1); *************** *** 988,995 **** tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, 0, 0); ! if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx && ! tty_term_has(tty->term, TTYC_EL)) { for (i = 0; i < ctx->ocy; i++) { tty_putcode(tty, TTYC_EL); tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1); --- 979,985 ---- tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, 0, 0); ! if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) { for (i = 0; i < ctx->ocy; i++) { tty_putcode(tty, TTYC_EL); tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1); *************** *** 1018,1025 **** tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, 0, 0); ! if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx && ! tty_term_has(tty->term, TTYC_EL)) { for (i = 0; i < screen_size_y(s); i++) { tty_putcode(tty, TTYC_EL); if (i != screen_size_y(s) - 1) { --- 1008,1014 ---- tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1); tty_cursor_pane(tty, ctx, 0, 0); ! if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) { for (i = 0; i < screen_size_y(s); i++) { tty_putcode(tty, TTYC_EL); if (i != screen_size_y(s) - 1) {