Merge branch 'master' into floating_panes

This commit is contained in:
Michael Grant
2026-03-26 20:51:42 +00:00
8 changed files with 1352 additions and 1326 deletions

View File

@@ -1,9 +1,4 @@
THIS IS FOR INFORMATION ONLY, CODE IS UNDER THE LICENCE AT THE TOP OF ITS FILE. Copyright (c) Various Authors
The README, CHANGES, FAQ and TODO files are licensed under the ISC license. All
other files have a license and copyright notice at their start, typically:
Copyright (c) <author>
Permission to use, copy, modify, and distribute this software for any Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above purpose with or without fee is hereby granted, provided that the above

2
grid.c
View File

@@ -1117,7 +1117,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
if (gc.flags & GRID_FLAG_PADDING) if (gc.flags & GRID_FLAG_PADDING)
continue; continue;
if (flags & GRID_STRING_WITH_SEQUENCES) { if (lastgc != NULL && (flags & GRID_STRING_WITH_SEQUENCES)) {
grid_string_cells_code(*lastgc, &gc, code, sizeof code, grid_string_cells_code(*lastgc, &gc, code, sizeof code,
flags, s, &has_link); flags, s, &has_link);
codelen = strlen(code); codelen = strlen(code);

View File

@@ -1617,7 +1617,7 @@ input_csi_dispatch(struct input_ctx *ictx)
if (ictx->wp != NULL) if (ictx->wp != NULL)
oo = ictx->wp->options; oo = ictx->wp->options;
else else
oo = global_options; oo = global_w_options;
p = options_get_number(oo, "cursor-style"); p = options_get_number(oo, "cursor-style");
/* blink for 1,3,5; steady for 0,2,4,6 */ /* blink for 1,3,5; steady for 0,2,4,6 */
@@ -2522,7 +2522,7 @@ input_handle_decrqss(struct input_ctx *ictx)
if (wp != NULL) if (wp != NULL)
oo = wp->options; oo = wp->options;
else else
oo = global_options; oo = global_w_options;
opt_ps = options_get_number(oo, "cursor-style"); opt_ps = options_get_number(oo, "cursor-style");
/* Sanity clamp: valid Ps are 0..6 per DECSCUSR. */ /* Sanity clamp: valid Ps are 0..6 per DECSCUSR. */
@@ -2562,7 +2562,8 @@ input_dcs_dispatch(struct input_ctx *ictx)
#endif #endif
if (wp == NULL) if (wp == NULL)
return (0); oo = global_w_options;
else
oo = wp->options; oo = wp->options;
if (ictx->flags & INPUT_DISCARD) { if (ictx->flags & INPUT_DISCARD) {
@@ -2571,8 +2572,8 @@ input_dcs_dispatch(struct input_ctx *ictx)
} }
#ifdef ENABLE_SIXEL #ifdef ENABLE_SIXEL
if (wp != NULL && buf[0] == 'q' && ictx->interm_len == 0) {
w = wp->window; w = wp->window;
if (buf[0] == 'q' && ictx->interm_len == 0) {
if (input_split(ictx) != 0) if (input_split(ictx) != 0)
return (0); return (0);
p2 = input_get(ictx, 1, 0, 0); p2 = input_get(ictx, 1, 0, 0);

View File

@@ -1173,7 +1173,7 @@ mode_tree_display_help(__unused struct mode_tree_data *mtd, struct client *c)
} }
for (line = mode_tree_help_start; *line != NULL; line++) for (line = mode_tree_help_start; *line != NULL; line++)
h++; h++;
for (line = lines; *line != NULL; line++) for (line = lines; line != NULL && *line != NULL; line++)
h++; h++;
for (line = mode_tree_help_end; *line != NULL; line++) for (line = mode_tree_help_end; *line != NULL; line++)
h++; h++;
@@ -1194,7 +1194,7 @@ mode_tree_display_help(__unused struct mode_tree_data *mtd, struct client *c)
popup_write(c, new_line, strlen(new_line)); popup_write(c, new_line, strlen(new_line));
free(new_line); free(new_line);
} }
for (line = lines; *line != NULL; line++) { for (line = lines; line != NULL && *line != NULL; line++) {
new_line = cmd_template_replace(*line, item, 1); new_line = cmd_template_replace(*line, item, 1);
popup_write(c, new_line, strlen(new_line)); popup_write(c, new_line, strlen(new_line));
free(new_line); free(new_line);
@@ -1214,7 +1214,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
struct mode_tree_line *line; struct mode_tree_line *line;
struct mode_tree_item *current, *parent, *mti; struct mode_tree_item *current, *parent, *mti;
u_int i, x, y; u_int i, x, y;
int choice; int choice, preview;
if (KEYC_IS_MOUSE(*key) && m != NULL) { if (KEYC_IS_MOUSE(*key) && m != NULL) {
if (cmd_mouse_at(mtd->wp, m, &x, &y, 0) != 0) { if (cmd_mouse_at(mtd->wp, m, &x, &y, 0) != 0) {
@@ -1226,9 +1226,10 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
if (yp != NULL) if (yp != NULL)
*yp = y; *yp = y;
if (x > mtd->width || y > mtd->height) { if (x > mtd->width || y > mtd->height) {
preview = mtd->preview;
if (*key == KEYC_MOUSEDOWN3_PANE) if (*key == KEYC_MOUSEDOWN3_PANE)
mode_tree_display_menu(mtd, c, x, y, 1); mode_tree_display_menu(mtd, c, x, y, 1);
if (mtd->preview == MODE_TREE_PREVIEW_OFF) if (preview == MODE_TREE_PREVIEW_OFF)
*key = KEYC_NONE; *key = KEYC_NONE;
return (0); return (0);
} }

View File

@@ -1476,14 +1476,12 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
oy += ctx->statuslines; /* Top of window in tty. */ oy += ctx->statuslines; /* Top of window in tty. */
} }
/* Set up style for slider. */
gc = sb_style->gc; gc = sb_style->gc;
memcpy(&slgc, &gc, sizeof slgc); memcpy(&slgc, &gc, sizeof slgc);
slgc.fg = gc.bg; slgc.fg = gc.bg;
slgc.bg = gc.fg; slgc.bg = gc.fg;
if (sb_x + (int)sb_w < 0) if (sb_x + (int)sb_w < 0 || sb_x >= sx || sb_y >= sy)
/* Whole sb off screen. */ /* Whole sb off screen. */
return; return;
if (sb_x < 0) if (sb_x < 0)

2599
tmux.1

File diff suppressed because it is too large Load Diff

View File

@@ -48,12 +48,19 @@ static void
tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx, tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx,
const struct grid_cell *defaults, u_int bg, int wrapped) const struct grid_cell *defaults, u_int bg, int wrapped)
{ {
struct visible_ranges *r;
struct visible_range *rr;
u_int i;
/* Nothing to clear. */ /* Nothing to clear. */
if (nx == 0) if (nx == 0)
return; return;
/* If genuine BCE is available, can try escape sequences. */ /* If genuine BCE is available, can try escape sequences. */
if (!wrapped && nx >= 10 && !tty_fake_bce(tty, defaults, bg)) { if (tty->client->overlay_check == NULL &&
!wrapped &&
nx >= 10 &&
!tty_fake_bce(tty, defaults, bg)) {
/* Off the end of the line, use EL if available. */ /* Off the end of the line, use EL if available. */
if (px + nx >= tty->sx && tty_term_has(tty->term, TTYC_EL)) { if (px + nx >= tty->sx && tty_term_has(tty->term, TTYC_EL)) {
tty_cursor(tty, px, py); tty_cursor(tty, px, py);
@@ -77,14 +84,20 @@ tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx,
} }
/* Couldn't use an escape sequence, use spaces. */ /* Couldn't use an escape sequence, use spaces. */
if (px != 0 || !wrapped) r = tty_check_overlay_range(tty, px, py, nx);
tty_cursor(tty, px, py); for (i = 0; i < r->used; i++) {
if (nx == 1) rr = &r->ranges[i];
if (rr->nx != 0) {
if (rr->px != 0 || !wrapped)
tty_cursor(tty, rr->px, py);
if (rr->nx == 1)
tty_putc(tty, ' '); tty_putc(tty, ' ');
else if (nx == 2) else if (rr->nx == 2)
tty_putn(tty, " ", 2, 2); tty_putn(tty, " ", 2, 2);
else else
tty_repeat_space(tty, nx); tty_repeat_space(tty, rr->nx);
}
}
} }
/* Is this cell empty? */ /* Is this cell empty? */

13
tty.c
View File

@@ -1170,6 +1170,9 @@ tty_clear_line(struct tty *tty, const struct grid_cell *defaults, u_int py,
u_int px, u_int nx, u_int bg) u_int px, u_int nx, u_int bg)
{ {
struct client *c = tty->client; struct client *c = tty->client;
struct visible_ranges *r;
struct visible_range *rr;
u_int i;
log_debug("%s: %s, %u at %u,%u", __func__, c->name, nx, px, py); log_debug("%s: %s, %u at %u,%u", __func__, c->name, nx, px, py);
@@ -1205,8 +1208,14 @@ tty_clear_line(struct tty *tty, const struct grid_cell *defaults, u_int py,
* Couldn't use an escape sequence, use spaces. Clear only the visible * Couldn't use an escape sequence, use spaces. Clear only the visible
* bit if there is an overlay. * bit if there is an overlay.
*/ */
tty_cursor(tty, px, py); r = tty_check_overlay_range(tty, px, py, nx);
tty_repeat_space(tty, nx); for (i = 0; i < r->used; i++) {
rr = &r->ranges[i];
if (rr->nx != 0) {
tty_cursor(tty, rr->px, py);
tty_repeat_space(tty, rr->nx);
}
}
} }
/* Clear a line, adjusting to visible part of pane. */ /* Clear a line, adjusting to visible part of pane. */