diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-30 09:26:50 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-30 09:26:50 +0000 |
commit | fb4a7fc3c0a8d954c754403ae62bebb68f2a70a6 (patch) | |
tree | a4d8c5de1f2bcd5ea9a35c413d2f320a0912b398 /usr.bin | |
parent | a8362f876c9d1cae44fc72afcc895fae25f190b2 (diff) |
Send two cub1 instead of using cub for moving the cursor two left. This
is normally better because using cub1 will be ^H^H (so two bytes) but
cub would be ^[[2D (four).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/tty.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 1c85d043a6a..f30d7db0214 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.201 2016/04/30 18:59:02 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.202 2016/05/30 09:26:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1345,7 +1345,7 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) */ /* To left edge. */ - if (cx == 0) { + if (cx == 0) { tty_putc(tty, '\r'); goto out; } @@ -1373,6 +1373,11 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) tty_putcode1(tty, TTYC_HPA, cx); goto out; } else if (change > 0 && tty_term_has(term, TTYC_CUB)) { + if (change == 2 && tty_term_has(term, TTYC_CUB1)) { + tty_putcode(tty, TTYC_CUB1); + tty_putcode(tty, TTYC_CUB1); + goto out; + } tty_putcode1(tty, TTYC_CUB, change); goto out; } else if (change < 0 && tty_term_has(term, TTYC_CUF)) { |