Commit Graph

331 Commits

Author SHA1 Message Date
Michael Grant
b018c5a3b7 Revert "End a SIXEL string at an Escape that is not followed by a backslash." This reverts commit 7b45ee638. 2026-10-14 16:03:04 +02:00
Michael Grant
7b45ee638b End a SIXEL string at an Escape that is not followed by a backslash.
An unterminated SIXEL image kept the pane in the DCS state, so everything
the program printed afterwards was swallowed until the timeout, and the image
itself was never drawn. Treat the Escape as the end of the image, as other
terminals do, and handle the sequence after it normally. Other DCS strings
are unchanged.
2026-10-14 15:29:49 +02:00
Nicholas Marriott
8856c1e669 Merge image_merge into 4902-image-support
Keep retained indexed SIXEL data and the bounded per-terminal output cache.
Use the cleaned-up decoder and RGBA encoder from image_merge, including
parser memory limits, pixel-size handling and references for pending output.
Match retained SIXEL scaling to the shared image cell footprint and emit
black definitions for undefined colour registers.

Keep Kitty input, output, layers and placeholders. Adapt backend selection,
flags, drawing and cleanup to the callbacks and Iscrl capability. Keep the
pane-status repaint with the requested XXX comment.

Replace the elaborate fallback with image_merge's implementation, removing
its caches, sample structures, quadrant/sextant features and ACS additions.
Keep the image_merge regressions and adapt the Kitty tests to the simpler
fallback. Use skip status 101 and disable Python bytecode for image tests.

Small changes still outside image_merge:
- Guard zero-height synchronized redraws before bit_nset.
- Select the image backend when the tty opens.
- Enable imagescroll by default for Kitty and Ghostty.
- Keep the explanatory manual-window pixel-size comment (comment only).
- Keep the additional SIXEL fixtures and visual test tools.

Validation: image-enabled and disabled builds; 31 image and 13 related
regressions pass normally and under ASAN. All image tests skip without
images. Focused palette, parser, scaling, transparency and Kitty layer
tests also pass after the retained-output adjustments. Diff checks clean.
2026-10-14 14:28:22 +01:00
Nicholas Marriott
e40cbf4ee8 Update sizes on WINSZ. 2026-10-14 14:03:54 +01:00
Nicholas Marriott
d4d065c76c Use imagescroll feature. 2026-10-14 13:55:06 +01:00
Michael Grant
82d8c67504 Recalculate window sizes when the terminal reports its pixel size.
The reply to CSI 14t updated the client's cell size but not the windows,
which kept the default 16x32 cell size until some other event (a resize, or
any client connecting or exiting) triggered recalculate_sizes(). Images
parsed in the meantime were sized for the wrong cell and drawn at the wrong
size. Recalculate when the reply arrives, and extend the reply test to check
that the window follows the client without any other event.
2026-10-14 14:11:55 +02:00
Nicholas Marriott
7fc663ee0d Add a test. 2026-10-14 12:59:42 +01:00
Nicholas Marriott
1de5f662cb Image regress tests. 2026-10-14 12:44:53 +01:00
Michael Grant
7e4dc561ca Ignore stray characters in SIXEL data instead of discarding the image. Regression test included. 2026-10-14 11:44:44 +02:00
Nicholas Marriott
4b06bdd63b Merge master into 4902-image-support 2026-10-13 21:18:26 +01:00
Nicholas Marriott
fca791a6f6 OSC 133 cmdline tests. 2026-10-13 11:22:15 +01:00
Nicholas Marriott
80fbab8ae8 Fix test on macOS. 2026-10-13 08:20:29 +01:00
Nicholas Marriott
657fe07a89 Accidentally added this test too before the fix. 2026-10-13 07:13:09 +01:00
Nicholas Marriott
9551cdcd67 Add test for killing own session crash. 2026-10-12 19:31:00 +01:00
Nicholas Marriott
f803c8cbba Remove test that depends on compiler. 2026-10-12 17:03:23 +01:00
Nicholas Marriott
2da1e0f30c Merge branch 'master' into 4902-image-support
# Conflicts:
#	Makefile.am
#	configure.ac
#	format.c
#	image-sixel.c
#	regress/tty-keys-replies.sh
#	resize.c
#	screen-redraw.c
#	screen-write.c
#	screen.c
#	tmux.1
#	tmux.h
#	tty-features.c
#	tty.c
2026-10-12 17:01:36 +01:00
Nicholas Marriott
58eb73a6d1 Fix DA test with images on. 2026-10-12 16:37:21 +01:00
Nicholas Marriott
30791b7376 Tests for image bits. 2026-10-12 16:36:04 +01:00
Nicholas Marriott
8f7cf1fdef Add ncv test. 2026-10-12 12:38:04 +01:00
Nicholas Marriott
b868c9aa14 Tests for 5722-5725. 2026-10-12 11:54:19 +01:00
Nicholas Marriott
12f8dddc7c Tests for 5730 from Joan Fabrégat. 2026-10-12 10:37:25 +01:00
Nicholas Marriott
634e96f8cc Tests for 5718. 2026-10-12 09:09:35 +01:00
Nicholas Marriott
e94426e02b Test for session group name. 2026-10-12 08:55:36 +01:00
Michael Grant
f988a7bc0b Match Kitty image sizing and layer order, preserve trailing backgrounds, and add regression coverage. 2026-10-10 17:51:50 +02:00
Michael Grant
7576d49578 Match Kitty image cursor movement to terminal behaviour and add regression coverage. 2026-10-10 16:23:42 +02:00
Michael Grant
6b456f4462 Added regression coverage for: Single and chunked compressed PNG uploads, missing or incorrect S values, and Kitty auto-detection from whole and fragmented XTVERSION replies. 2026-10-10 09:53:02 +02:00
Michael Grant
e29f9f7076 Do not allocate when a Kitty payload chunk decodes to no bytes. 2026-10-09 23:10:15 +02:00
Michael Grant
4b13e0c3d7 Fix off-by-one buffer growth in sixel_print_add and add regression test. 2026-10-09 23:10:15 +02:00
Michael Grant
554aedf09b Extend Kitty graphics protocol regression coverage. 2026-10-09 23:10:15 +02:00
Michael Grant
8f1efea3da Fix Kitty image deletion, placeholders and placement geometry. 2026-10-09 23:10:15 +02:00
Michael Grant
2118a927e9 Fix Kitty image cursor movement, replies and screen clearing. 2026-10-09 23:10:15 +02:00
Michael Grant
c6112a2a3a Accept independently padded base64 chunks in Kitty image transfers. 2026-10-09 23:10:15 +02:00
Michael Grant
3db73d7fdb Clean up image support and add regression tests 2026-10-09 23:10:15 +02:00
Michael Grant
21948cd117 regress: rationalise image test coverage, add missing image_support guard
- Extract shared setup for the "noflash" retransmission-avoidance tests
  (image-movepane-drag-noflash.sh, image-splitwindow-resize-noflash.sh,
  image-status-pane-click-noflash.sh, image-selection-noflash.sh) into
  a new image-noflash-common.inc, matching the existing input-common.inc
  convention: dual-server cleanup/fail helpers, the shared SIXEL fixture,
  the attach-and-capture sequence, and the final DCS-retransmission
  assertion. Each test keeps its own distinct interaction and failure
  message; only the copy-pasted scaffolding moved.

- Add the missing #{image_support} runtime guard to
  image-border-status-sixel.sh, which cats a real SIXEL fixture and
  specifically guards a sixel-after-pane-creation ordering bug - without
  it, the DCS sequence is compiled out entirely on a non-image build and
  the test's assertions could pass without exercising anything.
  image-border-status-wipe.sh is deliberately left unguarded: it has no
  image/sixel content at all and guards a general border-status caching
  bug unrelated to ENABLE_IMAGES.

- Reviewed the rest of the branch's regress/image-*.sh tests in full
  (not just headers) for redundant coverage; none warranted merging -
  each guards a genuinely distinct fix via a distinct mechanism.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-09 23:10:15 +02:00
Michael Grant
a06673bd8c Fix to drop SIXEL cells that a newer image completely covers. And regression test added. 2026-10-09 23:10:15 +02:00
Michael Grant
f9cf0b9852 Implement generalised image support
Support Kitty and SIXEL input and output with grid-resident image layers, history and copy-mode integration, text fallback rendering, and damage-rectangle redraws.

Consolidate the image work through 250f96b4b onto the redraw-damage-rectangles-new base, excluding the superseded redraw implementation and its historical merges. The original history is preserved in backup/4902-image-support-before-master-rebase-20261003.
2026-10-09 23:10:15 +02:00
Nicholas Marriott
48bbaa1172 Test for 5701. 2026-10-08 08:06:59 +01:00
Nicholas Marriott
ae33689815 Test for 5702. 2026-10-08 07:31:03 +01:00
Nicholas Marriott
5512949947 Test for 5696. 2026-10-07 14:14:02 +01:00
Nicholas Marriott
052c54fb49 Test for 5399. 2026-10-07 14:01:09 +01:00
Nicholas Marriott
b04055d577 Test for join-pane with modal floating pane. 2026-10-07 13:03:16 +01:00
Nicholas Marriott
6c30e1bc03 Make terminal bigger so test works on macOS. 2026-10-07 11:18:24 +01:00
Nicholas Marriott
a8158b2443 Fix test on macOS and add new test for tty. 2026-10-07 11:02:08 +01:00
Nicholas Marriott
f5c8e5acbd Fix tests. 2026-10-07 10:45:25 +01:00
Nicholas Marriott
3e22d43c66 Fix tests. 2026-10-07 10:16:50 +01:00
Nicholas Marriott
2d7bca72e7 Fix tests. 2026-10-07 09:42:00 +01:00
Nicholas Marriott
7b4d4074cf Fix tests. 2026-10-07 09:08:33 +01:00
Nicholas Marriott
3b20a0418a Fix tests. 2026-10-07 08:06:16 +01:00
Nicholas Marriott
20555f1508 Fix tests. 2026-10-07 07:29:44 +01:00
Nicholas Marriott
209d389a81 Fix test again. 2026-10-07 06:46:25 +01:00