diff --git a/tty.c b/tty.c index a04a5414..cf84927c 100644 --- a/tty.c +++ b/tty.c @@ -2248,10 +2248,11 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) (gcp->data.width == 1 && !tty_check_overlay(tty, px, py))) return; + vr = screen_redraw_get_visible_ranges(wp, px, py, + gcp->data.width); + /* Handle partially obstructed wide characters. */ if (gcp->data.width > 1) { - vr = screen_redraw_get_visible_ranges(wp, px, py, - gcp->data.width); for (i = 0; i < vr->used; i++) vis2 += vr->nx[i]; tty_check_overlay_range(tty, px, py, gcp->data.width, &r); @@ -2273,8 +2274,9 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) tty_margin_off(tty); tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy); - tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette, - ctx->s->hyperlinks); + if (screen_redraw_is_visible(vr, px)) + tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette, + ctx->s->hyperlinks); if (ctx->num == 1) tty_invalidate(tty); diff --git a/window-copy.c b/window-copy.c index f93e548b..0f7e223d 100644 --- a/window-copy.c +++ b/window-copy.c @@ -5810,7 +5810,10 @@ window_copy_drag_update(struct client *c, struct mouse_event *m) if (c == NULL) return; - wp = cmd_mouse_pane(m, NULL, NULL); + if (c->tty.mouse_wp != NULL) + wp = c->tty.mouse_wp; + else + wp = cmd_mouse_pane(m, NULL, NULL); if (wp == NULL) return; wme = TAILQ_FIRST(&wp->modes);