summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-05-30 07:42:42 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-05-30 07:42:42 +0000
commitb17ba1c6b85ca8c3eab6834e65fafe5ff0bea386 (patch)
tree456a2e790e07017db2b3b638740660b60fc9537a /usr.bin
parent272656806e59d132171172caf23a15398e8aa4e3 (diff)
I had hoped that non-xenl terminals had died out, at least in fairly
modern OSs, but no - DragonFly BSD's console returns to haunt us. Fix it at least somewhat. GitHub issue 1763.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tmux.16
-rw-r--r--usr.bin/tmux/tty.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 02aacfc1867..be62231eb8a 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.660 2019/05/29 10:08:36 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.661 2019/05/30 07:42:41 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 29 2019 $
+.Dd $Mdocdate: May 30 2019 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -4325,7 +4325,7 @@ Align text to the left, centre or right of the available space if appropriate.
.It Xo Ic list=on ,
.Ic list=focus ,
.Ic list=left-marker ,
-.Ic list=right=marker ,
+.Ic list=right-marker ,
.Ic nolist
.Xc
Mark the position of the various window list components in the
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 6c6aecfb58a..39e56d5e740 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.324 2019/05/13 20:10:23 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.325 2019/05/30 07:42:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -527,6 +527,12 @@ tty_putc(struct tty *tty, u_char ch)
{
const char *acs;
+ if ((tty->term->flags & TERM_EARLYWRAP) &&
+ ch >= 0x20 && ch != 0x7f &&
+ tty->cy == tty->sy - 1 &&
+ tty->cx + 1 >= tty->sx)
+ return;
+
if (tty->cell.attr & GRID_ATTR_CHARSET) {
acs = tty_acs_get(tty, ch);
if (acs != NULL)
@@ -557,6 +563,11 @@ tty_putc(struct tty *tty, u_char ch)
void
tty_putn(struct tty *tty, const void *buf, size_t len, u_int width)
{
+ if ((tty->term->flags & TERM_EARLYWRAP) &&
+ tty->cy == tty->sy - 1 &&
+ tty->cx + len >= tty->sx)
+ len = tty->sx - tty->cx - 1;
+
tty_add(tty, buf, len);
if (tty->cx + width > tty->sx) {
tty->cx = (tty->cx + width) - tty->sx;