Repository navigation
Conversation
FtxuiBackend now draws images in real pixels where the terminal can: - Kitty: each image is sent once, out of band, after the frame that first draws it (a=T, U=1, f=24, q=2, chunked base64), and shown through Unicode placeholder cells (U+10EEEE + row/column diacritics, fg = image id). A window or menu over an image hides exactly the cells it covers, and FTXUI's full repaint redraws the placeholders. An image is re-sent only when its pixels change and deleted once no frame draws it; images wider or taller than 297 cells go as tiles. - Sixel: a bitmap is re-sent after each draw, inside synchronized-output marks, clipped to the cells nothing covers (the node draws a half-block underlay; a pass after the frame finds the cells still showing it). Fixed 6x7x6 palette (fewer where XTSMGRAPHICS says so), ordered dither. run() probes the terminal before FTXUI takes the tty (a kitty query, CSI 16 t and DA1 on /dev/tty in raw mode), merges FTXUI's DA1 capabilities for Sixel, and reads the cell size in pixels from TIOCGWINSZ every frame. Options::cell_px_w/h stays the layout unit; the real cell size only sets the raster. Options::ImageColor gains Kitty and Sixel; Auto picks Kitty, else Sixel (when the cell size is known), else half-blocks. Hosted mode (tvision) keeps half-blocks. The encoders and the probe-reply parser are pure functions in term_graphics.h, unit-tested in ariadne_term_graphics_test. take_graphics() returns the bytes run() writes after a frame, so the backend paths are tested headless too. cvcGL's TerminalScene renders at the cells' real pixels when a pixel mode is on (FtxuiBackend::image_raster) and maps drags with the frame's own pixels per cell. ari and ariadne_terminal take --graphics; ari also takes --image NAME=FILE (new example terminal_images.ari), and snapshot --cell-size. The .ari schema now allows an image widget's scalar size.
…-terminal-graphics # Conflicts: # docs/ARIADNE.md # src/ari/main.cpp # src/cvc/CMakeLists.txt # src/cvc/tests/CMakeLists.txt
transfix
added a commit
that referenced
this pull request
Oct 20, 2026
…the row-split first-walk fix (#727) Carries #724 (Kitty + Sixel image modes for FtxuiBackend) and adds table column persistence. - Kitty: images sent once, out of band, shown through Unicode placeholder cells (window occlusion and FTXUI's full repaint just work), re-sent only when their pixels change, deleted when no longer drawn, tiled past 297 cells. Sixel: re-sent after each draw inside synchronized-output marks, clipped to the cells nothing covers. run() probes the tty before FTXUI (kitty query, CSI 16 t, DA1; TIOCGWINSZ per frame); ImageColor gains Kitty/Sixel, Auto picks the best. Pure encoders in term_graphics.h with unit tests. TerminalScene renders at the cells' real pixels. Host flags --graphics, --image NAME=FILE and --cell-size join the shared host CLI. - Resizable tables persist column widths to tree.<id>.columns (Backend::seed_grid_columns / grid_columns), px for every column, 0 = not set; ImGui seeds stretch columns as weights and reads Columns[i].WidthGiven, FTXUI fixes seeded columns. - Row-split fix: a naturally laid-out pane reports 0 instead of the 16 px of a box never laid out, so a reload no longer pins it at one row.
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Real pixels for images in the FTXUI terminal backend: the Kitty graphics protocol first, then Sixel, with half-blocks as the fallback. Roadmap §16.6, phasing step 3.
What changes
Kitty (kitty, Ghostty, WezTerm, Konsole)
a=T,U=1,f=24,q=2, chunked base64.a=d,d=I) once no frame draws it, and everything is released on exit.Sixel (xterm -ti vt340, foot, mlterm, WezTerm, Windows Terminal)
CSI ? 2026). Kitty transmissions go after the closing mark, because a big frame overflowed kitty's pending-update buffer.Detection and units
run()probes before FTXUI takes the tty: a kitty query,CSI 16 tand DA1, on/dev/ttyin raw mode. FTXUI's parser has no APC case, so a later kitty reply would arrive as typed text.TerminalCapabilities().TIOCGWINSZ(elseCSI 16 t) and is re-read every frame, so a font-size change follows.Options::cell_px_w/hstays the layout unit, so persisted geometry stays portable. The real size only sets the raster:image_raster(), andmax_image_pixels(1 Mi) caps Kitty transmissions.ImageColorgainsKittyandSixel.Autopicks Kitty, else Sixel (only when the cell size is known), else half-blocks.Testable pieces
inc/cvc/ariadne/term_graphics.hholds the pure functions: base64, kitty transmit/delete/placeholder, the Sixel encoder, the probe query and reply parser, and the rectangle cover.take_graphics()returns the bytesrun()writes after a frame, so the backend paths are tested headless.cvcGL
TerminalScenerenders at the cells' real pixels when a pixel mode is on, and maps drags with the frame's own pixels per cell.Hosts
ariandariadne_terminaltake--graphics auto|kitty|sixel|color|mono.arialso takes--image NAME=FILE, to publish a picture forimage:widgets; the new example isterminal_images.ari.snapshot --ansi --graphics kitty|sixelprints the images too, with--cell-size WxHwhere the terminal can't be asked..arischema now allows an image widget's scalarsize:.components/raster_view.ariwarned on it too.Verification
ariadne_term_graphics_test: 15 new tests. They cover RFC 4648 vectors, the diacritic table, chunking and the stride, and the probe parser on kitty, xterm, error and partial replies. A small in-test Sixel decoder round-trips solid colours exactly, dithered colours within one level, run-length coding and the stride.ariadne_ftxui_test: 8 new tests on top of 42. They cover mode resolution (tvision stays half-blocks), the raster size, Kitty send-once / resend-on-change / delete, the background under a window, tiling past 297 columns, Sixel rectangles, bands and order, and a window over a Sixel image.cvcgl_terminal_scene: extended for real-pixel rendering in both modes, and checks that an unchanged frame is not re-sent.ctest -R 'ariadne|Ariadne|cvcgl_terminal_scene': 403/403.convert sixel:) decodes the output to the source image within a fixed-palette dither (RMSE 7.6%).ari run terminal_images.ari --image photo=…showed the picture in real pixels. A second window dragged onto it (SGR mouse viakitty @ send-text) hid exactly the cells it covered.ariadne_terminal terminal_scene.aridrew the 3D scene at full pixel resolution behind its window, background drags orbited it, and kitty logged no warnings.kitty +runpy, headless) accepted the transmission: one image of the expected size, one virtual placement, and the expected placeholder count.snapshot --ansi --graphics sixel --cell-size 9x17frames were fed to xterm.js with@xterm/addon-image(VS Code's Sixel implementation) in a browser. Both the picture under an overlapping window and the 3D scene with its menu bar rendered correctly. The interactive loop's per-draw re-send has not been watched in a live Sixel terminal.Not covered (follow-ups)
Autostays half-blocks there;KittyandSixelcan still be forced.