Commit Graph

218 Commits

Author SHA1 Message Date
Michael Grant
69ee9cf7f4 Ordinary text writes replaced the entire grid cell, dropping GRID_FLAG_IMAGE and releasing the
mage reference. Deferred pane redraws explain the intermittent “image never appears” behavior.

Fixed:
  - Preserves image metadata while updating the text underlay in the collected ASCII path: grid.c:779
  - Handles the single-cell/non-ASCII path and schedules an image redraw: screen-write.c:2631
  - Uses the requested if/else for new_id.
  - Adds a deterministic regression reproducing point (2): regress/image-support.sh:240

  This matches Kitty’s requirement that normal text operations must not affect graphics; graphics require
  explicit deletion. Kitty graphics protocol
2026-08-25 11:22:26 +01:00
Michael Grant
3442c1f26f Fix underlay bookkeeping bug. 2026-08-25 11:22:26 +01:00
Michael Grant
628acfd802 Pass through wrapped Kitty graphics 2026-08-25 11:22:26 +01:00
Michael Grant
674cdd94f5 Add bptato's test to the regression test script. 2026-08-25 11:22:26 +01:00
Michael Grant
75b606c3df The two Chawan symptoms now have matching fixes:
- Layout corruption: C=1 is respected.
  - Lingering remnants: tmux now tracks Kitty’s (image ID, placement ID) identity, replaces moved placements, and honors
    placement-specific d=i,...,p=... deletion.
2026-08-25 11:22:26 +01:00
Michael Grant
d674f34f25 Support Kitty Unicode placeholder image transmission
- Parse Kitty graphics commands wrapped in tmux passthrough sequences.
  - Accept unpadded base64 payloads emitted by icat.
  - Handle chunked transfers whose final chunk omits m.
  - Track virtual image placements.
  - Convert Unicode placeholders into shared image cells for Kitty and SIXEL clients.
  - Add regression coverage for wrapped, chunked, unpadded input.
2026-08-25 11:22:26 +01:00
Michael Grant
8b44703b41 Fix SIXEL median-cut palette generation 2026-08-25 11:22:26 +01:00
Michael Grant
c0ab9b7b3f Revert "Removed unconditional Floyd–Steinberg dithering from image-sixel.c:1077. Kitty images now use the adaptive 256-colour median-cut palette with direct nearest-colour mapping."
This reverts commit ab591ae430.
2026-08-25 11:22:26 +01:00
Michael Grant
f81c41929b Fix kitty image resize issue when the kitty image resized smaller than the image, the image was overflowing lines and banding. 2026-08-25 11:22:26 +01:00
Michael Grant
cc4a76d0be Removed unconditional Floyd–Steinberg dithering from image-sixel.c:1077. Kitty images now use the adaptive 256-colour median-cut palette with direct nearest-colour mapping. 2026-08-25 11:22:26 +01:00
Michael Grant
52e2e2b0c0 C=1 is parsed and stored as an image-placement flag, suppressing cursor movement and scrolling as required by the Kitty protocol. 2026-08-25 11:22:26 +01:00
Michael Grant
c8fe307682 Support Kitty source rectangle placements 2026-08-25 11:22:26 +01:00
Michael Grant
643bb662a0 Preserve SIXEL pixel dimensions
Retain the padded canonical pixel canvas separately from the image content. Scale only the populated portion of partial edge cells so an image keeps its exact raster size on the originating terminal while retaining its cell footprint.
2026-08-25 11:22:26 +01:00
Michael Grant
d8da527882 Refactor to centralize image-specific rendering and lifecycle code in image.c and the image-* backends. 2026-08-25 11:22:26 +01:00
Michael Grant
8fc9c3a5f9 Add missing regression test files. 2026-08-25 11:22:26 +01:00
Michael Grant
aed1209c02 regress: add Michael K. Darling's damage/redraw regression tests
From github.com/darlingm/tmux, branch pr5516-regression-fixes. Adds 9
regression tests covering gaps found in the redraw-damage-rectangles
branch: screen-write full/region redraw fallback, same-session window
switches, wide-character clipping at damage edges, pane prompts and
status lines surviving damage, floating-pane status format refresh,
and multi-client damage delivery.

redraw-multiclient.sh is adapted here to use ASCII pane borders
(pane-border-lines simple) instead of darlingm's original UTF-8
borders: the original reliably "failed" under this test's nested
tmux-in-tmux harness (relaying through an outer tmux client) due to
that harness mis-rendering a cell that held a multi-byte UTF-8 border
character being overwritten by later plain content - confirmed to be
a nested-relay artifact, not a real bug, by replaying the identical
drag sequence against a real terminal (xterm), where it never
reproduces. ASCII borders avoid the artifact; the test still reliably
catches the real "damage consumed by only one client" bug it targets
(verified by reintroducing that bug and confirming the test fails).

The other 8 tests are added verbatim from darlingm's branch. Four of
them (popup-drag-status-line.sh, popup-drag-wide-character.sh,
popup-drag-pane-prompt.sh, switch-client-redraw.sh) currently FAIL on
this branch, since the source fixes they test for have not been
merged yet - only the tests are being added here.

Co-Authored-By: Michael K. Darling <darlingm@gmail.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 10:14:49 +01:00
Michael Grant
6739bd03f5 Merge remote-tracking branch 'origin/master' into redraw-damage-rectangles
# Conflicts:
#	server-client.c
#	window.c
2026-08-25 08:08:17 +01:00
Michael Grant
b254f557e4 md-join-pane, cmd-split-window, cmd-resize-pane: use shared floating-pane
redraw instead of full client redraw

The three interactive mouse-drag paths that move or resize a floating
pane (move-pane -M's Alt-drag, split-window/new-pane's interactive
resize, and resize-pane's own border drag) each unconditionally called
server_redraw_window(w), redrawing every pane in the window for a change
that only ever disturbs the floating pane's own old and new rectangle.
Switch all three to window_pane_redraw_floating().
2026-08-22 16:53:08 +01:00
Nicholas Marriott
936bb6e7cd Regress for GitHub issue 5511 from Francesc Rosas. 2026-08-21 10:54:29 +01:00
Nicholas Marriott
554c4bbde4 Tests for modal panes on top. 2026-08-20 10:19:19 +01:00
Nicholas Marriott
ac23f21a2c More regress tests for zoom. 2026-08-20 09:18:58 +01:00
Nicholas Marriott
8499d8007e new-pane -K test bits. 2026-08-19 11:56:27 +01:00
Nicholas Marriott
da641e4e8d Add test for GitHub issue 5498 from Alex Rattray. 2026-08-18 08:45:11 +01:00
Nicholas Marriott
19a085a672 Fix socket names for macOS. 2026-08-18 08:23:16 +01:00
Nicholas Marriott
30abbe36a8 Regress for sync, from xiangzhedev@gmail.com. 2026-08-17 21:04:26 +01:00
Nicholas Marriott
0ac8138ce3 Add a break-pane test for customize mode. 2026-08-17 08:06:31 +01:00
Nicholas Marriott
72e705cbd6 Tweak times for macOS. 2026-08-05 08:26:10 +01:00
Nicholas Marriott
f07a76d959 Use move-pane for a test. 2026-08-03 21:30:44 +01:00
Nicholas Marriott
ca0d77855f Client exit test from Ben Maurer. 2026-08-03 21:19:10 +01:00
Nicholas Marriott
cd3f577c85 Add test for control mode events and guards. 2026-08-03 20:27:10 +01:00
Nicholas Marriott
433a5cf580 Add regress test from Ayman Bagabas. 2026-08-03 13:59:27 +01:00
Nicholas Marriott
fc9270c943 Test for socket error from Rayan Salhab. 2026-08-03 11:09:04 +01:00
Nicholas Marriott
fa8c5789a6 Sleep after kill. 2026-08-03 09:53:50 +01:00
Nicholas Marriott
265fb7b4ea Test for vi keys and padding. 2026-07-29 21:18:38 +01:00
Nicholas Marriott
7cc0c11cde Add test for mouse menu position. 2026-07-28 14:18:18 +01:00
Nicholas Marriott
9c402fa7b7 Test hook time in customize mode. 2026-07-28 11:36:03 +01:00
Nicholas Marriott
3c1b2969a8 Tests for hooks time and count. 2026-07-28 08:08:26 +01:00
Nicholas Marriott
9b97dadc01 Test for pipe-pane. 2026-07-27 15:26:43 +01:00
Nicholas Marriott
0255981a54 Test run-shell if killed. 2026-07-26 16:08:58 +01:00
Nicholas Marriott
10726b1b27 Title stack test. 2026-07-26 10:21:01 +01:00
Nicholas Marriott
0768795ce3 Test for overlong runs of combining characters, GitHub issue 5434. 2026-07-26 10:02:31 +01:00
Nicholas Marriott
e361982acf Fix some tests. 2026-07-24 09:49:32 +01:00
Nicholas Marriott
a2f3bdb601 fill-character test bits. 2026-07-23 10:38:27 +01:00
Nicholas Marriott
38feebb5d2 Show options tests. 2026-07-23 08:06:09 +01:00
Nicholas Marriott
09a2ea190d Update test. 2026-07-22 20:24:21 +01:00
Nicholas Marriott
18fc547b82 Update show hooks tests. 2026-07-22 19:58:55 +01:00
Nicholas Marriott
0868435e81 Add test for A: modifier, from Fernando Daciuk. 2026-07-22 14:17:22 +01:00
Nicholas Marriott
2848a12562 Update tests for fix to floating panes at window edges. 2026-07-21 14:41:52 +01:00
Nicholas Marriott
3e61e63851 Test for outside panes with no border. 2026-07-21 12:56:32 +01:00
Nicholas Marriott
8aaae25e56 Fix a merge and add test bits. 2026-07-21 08:00:39 +01:00