summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2013-03-27 11:19:19 +0000
committernicm <nicm@openbsd.org>2013-03-27 11:19:19 +0000
commita8b553061093378ea8c0ae295556c5c153c94393 (patch)
treeb177cfab9cebb9232dcce20427a3e982b1d84000 /usr.bin/tmux/screen-write.c
parentRemove tmux's (already minimal) 88 colour support. Such terminals are (diff)
downloadwireguard-openbsd-a8b553061093378ea8c0ae295556c5c153c94393.tar.xz
wireguard-openbsd-a8b553061093378ea8c0ae295556c5c153c94393.zip
Move the cursor back into the last column on CUU/CUD to match xterm
behaviour. From George Nachman.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 71737ff1183..08616ccc6c5 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.65 2013/03/22 10:41:01 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.66 2013/03/27 11:19:19 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -488,6 +488,8 @@ screen_write_cursorup(struct screen_write_ctx *ctx, u_int ny)
if (ny > s->cy - s->rupper)
ny = s->cy - s->rupper;
}
+ if (s->cx == screen_size_x(s))
+ s->cx--;
if (ny == 0)
return;
@@ -512,6 +514,8 @@ screen_write_cursordown(struct screen_write_ctx *ctx, u_int ny)
if (ny > s->rlower - s->cy)
ny = s->rlower - s->cy;
}
+ if (s->cx == screen_size_x(s))
+ s->cx--;
if (ny == 0)
return;