Merge origin/4902-image-support into 4902-image-support

Keep the global SIXEL cache and retention removal while incorporating the Escape-termination revert. Remove the manual-size comment in resize.c.
This commit is contained in:
Nicholas Marriott
2026-10-14 15:43:21 +01:00
3 changed files with 2 additions and 39 deletions

28
input.c
View File

@@ -209,7 +209,6 @@ static void input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *);
static void input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *); static void input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *);
static void input_csi_dispatch_sgr(struct input_ctx *); static void input_csi_dispatch_sgr(struct input_ctx *);
static int input_dcs_dispatch(struct input_ctx *); static int input_dcs_dispatch(struct input_ctx *);
static int input_dcs_escape(struct input_ctx *);
static int input_top_bit_set(struct input_ctx *); static int input_top_bit_set(struct input_ctx *);
static int input_end_bel(struct input_ctx *); static int input_end_bel(struct input_ctx *);
@@ -700,9 +699,9 @@ static const struct input_transition input_state_dcs_handler_table[] = {
static const struct input_transition input_state_dcs_escape_table[] = { static const struct input_transition input_state_dcs_escape_table[] = {
/* No INPUT_STATE_ANYWHERE */ /* No INPUT_STATE_ANYWHERE */
{ 0x00, 0x5b, input_dcs_escape, &input_state_dcs_handler }, { 0x00, 0x5b, input_input, &input_state_dcs_handler },
{ 0x5c, 0x5c, input_dcs_dispatch, &input_state_ground }, { 0x5c, 0x5c, input_dcs_dispatch, &input_state_ground },
{ 0x5d, 0xff, input_dcs_escape, &input_state_dcs_handler }, { 0x5d, 0xff, input_input, &input_state_dcs_handler },
{ -1, -1, NULL, NULL } { -1, -1, NULL, NULL }
}; };
@@ -2627,29 +2626,6 @@ not_recognized:
return (0); return (0);
} }
/* Escape in a DCS string followed by anything other than a backslash. */
static int
input_dcs_escape(struct input_ctx *ictx)
{
static const struct input_transition to_ground = {
0, 0, NULL, &input_state_ground
};
u_char buf[2] = { '\033', ictx->ch };
/*
* Other strings carry the byte as data, but a SIXEL image ends at the
* Escape, which then starts a new sequence as usual.
*/
if (ictx->input_len == 0 ||
ictx->input_buf[0] != 'q' ||
ictx->interm_len != 0)
return (input_input(ictx));
input_dcs_dispatch(ictx);
input_set_state(ictx, &to_ground);
input_parse(ictx, buf, sizeof buf);
return (1);
}
/* DCS terminator (ST) received. */ /* DCS terminator (ST) received. */
static int static int
input_dcs_dispatch(struct input_ctx *ictx) input_dcs_dispatch(struct input_ctx *ictx)

View File

@@ -76,15 +76,6 @@ sleep 1
[ "$($TMUX display-message -pt:sixel-stray '#{cursor_y}')" -gt 0 ] || exit 1 [ "$($TMUX display-message -pt:sixel-stray '#{cursor_y}')" -gt 0 ] || exit 1
$TMUX kill-window -t:sixel-stray || exit 1 $TMUX kill-window -t:sixel-stray || exit 1
# A SIXEL string that is not terminated ends at the next Escape, and the
# sequence after it is still processed.
$TMUX new-window -d -n sixel-esc "
printf '\033Pq#0;2;100;0;0#0!8~\033[HXY'
sleep 10"
sleep 1
[ "$($TMUX capture-pane -pt:sixel-esc -S0 -E0)" = "XY" ] || exit 1
$TMUX kill-window -t:sixel-esc || exit 1
# The protocol default is transmit-only; a later placement uses the retained # The protocol default is transmit-only; a later placement uses the retained
# immutable image and advances by the same canonical one-cell footprint. # immutable image and advances by the same canonical one-cell footprint.
$TMUX new-window -d " $TMUX new-window -d "

View File

@@ -153,10 +153,6 @@ clients_calculate_size(int type, int current, struct client *c,
*sy = UINT_MAX; *sy = UINT_MAX;
} }
if (w != NULL && type == WINDOW_SIZE_MANUAL) { if (w != NULL && type == WINDOW_SIZE_MANUAL) {
/*
* Keep the window's pixel size in manual mode to avoid scheduling
* a resize on every recalculation.
*/
*xpixel = w->xpixel; *xpixel = w->xpixel;
*ypixel = w->ypixel; *ypixel = w->ypixel;
} else { } else {