=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.28 retrieving revision 1.29 diff -c -r1.28 -r1.29 *** src/usr.bin/tmux/screen-write.c 2009/10/12 16:33:39 1.28 --- src/usr.bin/tmux/screen-write.c 2009/10/12 16:59:55 1.29 *************** *** 1,4 **** ! /* $OpenBSD: screen-write.c,v 1.28 2009/10/12 16:33:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen-write.c,v 1.29 2009/10/12 16:59:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 513,518 **** --- 513,537 ---- s->cx -= nx; } + /* Backspace; cursor left unless at start of wrapped line when can move up. */ + void + screen_write_backspace(struct screen_write_ctx *ctx) + { + struct screen *s = ctx->s; + struct grid_line *gl; + + if (s->cx == 0) { + if (s->cy == 0) + return; + gl = &s->grid->linedata[s->grid->hsize + s->cy - 1]; + if (gl->flags & GRID_LINE_WRAPPED) { + s->cy--; + s->cx = screen_size_x(s) - 1; + } + } else + s->cx--; + } + /* VT100 alignment test. */ void screen_write_alignmenttest(struct screen_write_ctx *ctx) *************** *** 536,541 **** --- 555,561 ---- s->cy = 0; s->rupper = 0; + s->rlower = screen_size_y(s) - 1; tty_write(tty_cmd_alignmenttest, &ttyctx);