=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.300 retrieving revision 1.301 diff -c -r1.300 -r1.301 *** src/usr.bin/tmux/tty.c 2018/02/04 10:10:39 1.300 --- src/usr.bin/tmux/tty.c 2018/04/23 07:41:30 1.301 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.300 2018/02/04 10:10:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.301 2018/04/23 07:41:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1244,1256 **** tty_margin_pane(tty, ctx); /* ! * If we want to wrap a pane, the cursor needs to be exactly on the ! * right of the region. But if the pane isn't on the right, it may be ! * off the edge - if so, move the cursor back to the right. */ ! if (ctx->xoff + ctx->ocx > tty->rright) ! tty_cursor(tty, tty->rright, ctx->yoff + ctx->ocy); ! else tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); tty_putc(tty, '\n'); --- 1244,1261 ---- tty_margin_pane(tty, ctx); /* ! * If we want to wrap a pane while using margins, the cursor needs to ! * be exactly on the right of the region. If the cursor is entirely off ! * the edge - move it back to the right. Some terminals are funny about ! * this and insert extra spaces, so only use the right if margins are ! * enabled. */ ! if (ctx->xoff + ctx->ocx > tty->rright) { ! if (!tty_use_margin(tty)) ! tty_cursor(tty, 0, ctx->yoff + ctx->ocy); ! else ! tty_cursor(tty, tty->rright, ctx->yoff + ctx->ocy); ! } else tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); tty_putc(tty, '\n'); *************** *** 1275,1285 **** tty_margin_pane(tty, ctx); if (ctx->num == 1 || !tty_term_has(tty->term, TTYC_INDN)) { ! tty_cursor(tty, tty->rright, tty->rlower); for (i = 0; i < ctx->num; i++) tty_putc(tty, '\n'); ! } else tty_putcode1(tty, TTYC_INDN, ctx->num); } void --- 1280,1295 ---- tty_margin_pane(tty, ctx); if (ctx->num == 1 || !tty_term_has(tty->term, TTYC_INDN)) { ! if (!tty_use_margin(tty)) ! tty_cursor(tty, 0, tty->rlower); ! else ! tty_cursor(tty, tty->rright, tty->rlower); for (i = 0; i < ctx->num; i++) tty_putc(tty, '\n'); ! } else { ! tty_cursor(tty, 0, tty->cy); tty_putcode1(tty, TTYC_INDN, ctx->num); + } } void