Merge branch 'master' into floating_panes

This commit is contained in:
Nicholas Marriott
2026-05-17 15:55:09 +01:00
7 changed files with 38 additions and 20 deletions

11
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,11 @@
For pull request code reviews in this repository, do not leave any review comments under any circumstances.
If asked to review a pull request, produce no comments.
Do not comment on pull requests in this repository.
For pull request code reviews in this repository, do not leave a pull request overview.
Do not leave inline review comments.
If asked to review a pull request, provide no summary, no overview, and no code comments.

View File

@@ -846,9 +846,9 @@ control_stop(struct client *c)
if (evtimer_initialized(&cs->subs_timer))
evtimer_del(&cs->subs_timer);
control_reset_offsets(c);
TAILQ_FOREACH_SAFE(cb, &cs->all_blocks, all_entry, cb1)
control_free_block(cs, cb);
control_reset_offsets(c);
c->control_state = NULL;
free(cs);

View File

@@ -194,7 +194,8 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
if ((int)px == wp->xoff - sb_w - 1 &&
(!hsplit || (hsplit && py > wp->sy / 2)))
return (SCREEN_REDRAW_BORDER_LEFT);
if ((int)px == wp->xoff + (int)wp->sx + sb_w - 1)
if ((int)px == wp->xoff +
(int)wp->sx + sb_w - 1)
return (SCREEN_REDRAW_BORDER_RIGHT);
}
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT or disabled */
@@ -203,8 +204,7 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
return (SCREEN_REDRAW_BORDER_RIGHT);
if (wp->xoff != 0) {
if ((int)px == wp->xoff - 1 &&
(!hsplit ||
(hsplit && py > wp->sy / 2)))
(!hsplit || (hsplit && py > wp->sy / 2)))
return (SCREEN_REDRAW_BORDER_LEFT);
if (px == wp->xoff + wp->sx + sb_w)
return (SCREEN_REDRAW_BORDER_RIGHT);
@@ -222,8 +222,8 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
if (sb_pos == PANE_SCROLLBARS_LEFT) {
if ((wp->xoff - sb_w == 0 ||
(int)px >= wp->xoff - sb_w) &&
((int)px <= ex ||
(sb_w != 0 && (int)px < ex + sb_w))) {
((int)px <= ex || (sb_w != 0 &&
(int)px < ex + sb_w))) {
if (wp->yoff != 0 && (int)py == wp->yoff - 1)
return (SCREEN_REDRAW_BORDER_TOP);
if ((int)py == ey)
@@ -550,8 +550,8 @@ screen_redraw_check_cell(struct screen_redraw_ctx *ctx, u_int px, u_int py,
(int)py < wp->yoff + (int)wp->sy)) {
/* Check if px lies within a scrollbar. */
if ((sb_pos == PANE_SCROLLBARS_RIGHT &&
((int)px >= wp->xoff + (int)wp->sx &&
(int)px < wp->xoff + (int)wp->sx + sb_w)) ||
(px >= wp->xoff + wp->sx &&
px < wp->xoff + wp->sx + sb_w)) ||
(sb_pos == PANE_SCROLLBARS_LEFT &&
((int)px >= wp->xoff - sb_w &&
(int)px < wp->xoff)))
@@ -928,8 +928,8 @@ screen_redraw_draw_borders_style(struct screen_redraw_ctx *ctx, u_int x,
/* Draw arrow indicator if enabled. */
static void
screen_redraw_draw_border_arrows(struct screen_redraw_ctx *ctx, u_int i,
u_int j, u_int cell_type, struct window_pane *wp,
screen_redraw_draw_border_arrows(struct screen_redraw_ctx *ctx, int i,
int j, u_int cell_type, struct window_pane *wp,
struct window_pane *active, struct grid_cell *gc)
{
struct client *c = ctx->c;
@@ -1314,7 +1314,7 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
log_debug("%s: %s @%u %%%u", __func__, c->name, w->id, wp->id);
if (wp->xoff + (int)wp->sx <= (int)ctx->ox ||
if (wp->xoff + (int)wp->sx <= ctx->ox ||
wp->xoff >= (int)ctx->ox + (int)ctx->sx)
return;
@@ -1500,6 +1500,13 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
return;
imax = sx - sb_x;
}
jmax = sb_h;
if ((int)jmax + sb_y > sy) {
if (sb_y >= sy)
return;
jmax = sy - sb_y;
}
/*
* sb_y is a window coordinate; convert to tty coordinate by
* subtracting the pan offset oy.

View File

@@ -1091,6 +1091,8 @@ server_client_is_assume_paste(struct client *c)
return (0);
if ((t = options_get_number(s->options, "assume-paste-time")) == 0)
return (0);
if (tty_term_has(c->tty.term, TTYC_ENBP))
return (0);
timersub(&c->activity_time, &c->last_activity_time, &tv);
if (tv.tv_sec == 0 && tv.tv_usec < t * 1000) {

View File

@@ -175,7 +175,7 @@ utf8_should_combine(const struct utf8_data *with, const struct utf8_data *add)
return (1);
break;
}
return 0;
return (0);
}
static enum hanguljamo_subclass

2
utf8.c
View File

@@ -599,7 +599,7 @@ utf8_towc(const struct utf8_data *ud, wchar_t *wc)
case 0:
return (UTF8_ERROR);
}
log_debug("UTF-8 %.*s is %05X", (int)ud->size, ud->data, (u_int)*wc);
log_debug("UTF-8 %.*s is U+%06X", (int)ud->size, ud->data, (u_int)*wc);
return (UTF8_DONE);
}

View File

@@ -375,12 +375,10 @@ window_pane_destroy_ready(struct window_pane *wp)
{
int n;
if (wp->pipe_fd != -1) {
if (EVBUFFER_LENGTH(wp->pipe_event->output) != 0)
if (wp->pipe_fd != -1 && EVBUFFER_LENGTH(wp->pipe_event->output) != 0)
return (0);
if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0)
return (0);
}
if (~wp->flags & PANE_EXITED)
return (0);