From fb4a7fc3c0a8d954c754403ae62bebb68f2a70a6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 30 May 2016 09:26:50 +0000 Subject: 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). --- usr.bin/tmux/tty.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 @@ -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)) { -- cgit v1.2.3