summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2018-01-16 17:03:18 +0000
committernicm <nicm@openbsd.org>2018-01-16 17:03:18 +0000
commit943c45ac672cf761cfd29a15a9dcbe964e89cbcf (patch)
tree9fb8859b3b7bf95d906ba45fdfacec4163902cfc /usr.bin/tmux/tty.c
parentGETTY_SLEEP is 30 seconds, not 10 (diff)
downloadwireguard-openbsd-943c45ac672cf761cfd29a15a9dcbe964e89cbcf.tar.xz
wireguard-openbsd-943c45ac672cf761cfd29a15a9dcbe964e89cbcf.zip
Fix drawing of ACS characters (they need to go character-at-a-time),
accidentally broken in last commit.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index de9e6b21ce4..b4c0f432f75 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.298 2018/01/12 16:41:00 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.299 2018/01/16 17:03:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -977,17 +977,23 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
}
if (gcp->flags & GRID_FLAG_SELECTED)
- screen_select_cell(s, &last, &gc);
+ screen_select_cell(s, &last, gcp);
else
- memcpy(&last, &gc, sizeof last);
- if (ux + gcp->data.width > screen_size_x(s))
+ memcpy(&last, gcp, sizeof last);
+ if (ux + gcp->data.width > screen_size_x(s)) {
+ tty_attributes(tty, &last, wp);
for (j = 0; j < gcp->data.width; j++) {
if (ux + j > screen_size_x(s))
break;
tty_putc(tty, ' ');
ux++;
}
- else {
+ } else if (gcp->attr & GRID_ATTR_CHARSET) {
+ tty_attributes(tty, &last, wp);
+ for (j = 0; j < gcp->data.size; j++)
+ tty_putc(tty, gcp->data.data[j]);
+ ux += gc.data.width;
+ } else {
memcpy(buf + len, gcp->data.data, gcp->data.size);
len += gcp->data.size;
width += gcp->data.width;