diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..e49867ac --- /dev/null +++ b/.github/copilot-instructions.md @@ -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. diff --git a/control.c b/control.c index 6b7c3b26..b88072d3 100644 --- a/control.c +++ b/control.c @@ -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); diff --git a/screen-redraw.c b/screen-redraw.c index 7290e7c9..c55a1ba5 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -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) @@ -544,14 +544,14 @@ screen_redraw_check_cell(struct screen_redraw_ctx *ctx, u_int px, u_int py, * is not at the top, then yoff to yoff + sy. */ sb_w = wp->scrollbar_style.width + - wp->scrollbar_style.pad; + wp->scrollbar_style.pad; if ((wp->yoff == 0 && py < wp->sy) || ((int)py >= wp->yoff && (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. diff --git a/server-client.c b/server-client.c index b5e56060..e4e66236 100644 --- a/server-client.c +++ b/server-client.c @@ -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) { diff --git a/utf8-combined.c b/utf8-combined.c index 1eee3b82..65ecf9cd 100644 --- a/utf8-combined.c +++ b/utf8-combined.c @@ -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 diff --git a/utf8.c b/utf8.c index dc966814..e57100fd 100644 --- a/utf8.c +++ b/utf8.c @@ -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); } diff --git a/window.c b/window.c index cf9e8649..fb7dec8a 100644 --- a/window.c +++ b/window.c @@ -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) - return (0); - if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0) - return (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);