aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-30 11:02:27 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-30 11:02:27 +0100
commit82b25a9d6280d162db26af2a7c6710f0b9159d60 (patch)
tree143e633bfc8d7cd9553bda2a4b6320a479c2f258 /tty.c
parent026450c1a8ed64e49521bec676e2e1faba64c1aa (diff)
parent89d2c7eb2625804060092330f22ea211c2c97ba3 (diff)
downloadrtmux-82b25a9d6280d162db26af2a7c6710f0b9159d60.tar.gz
rtmux-82b25a9d6280d162db26af2a7c6710f0b9159d60.tar.bz2
rtmux-82b25a9d6280d162db26af2a7c6710f0b9159d60.zip
Merge branch 'obsd-master'
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 34403a1f..05df4f0f 100644
--- a/tty.c
+++ b/tty.c
@@ -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;