From 0bb65902ebec104dac954b59f28500812419e1af Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 00:45:14 -0300 Subject: A terminal's kitty graphics draw as glyph art where pixels cannot, and by choice: Petscii on the pane, TermImages for new ones Under an outer terminal without kitty graphics a tty pardes cannot pass a terminal pane's images on, so it draws them itself as an image pane's Petscii does: each row of an image is matched to C64-palette glyph art over the cells it covers (GlyphArt.renderRect, the exact-grid half of GlyphArt.render), cached while it is on screen. yazi is still told the kitty protocol works, so it keeps sending its previews. The same art is a choice anywhere: the Petscii builtin now takes a terminal pane too (PaneKind.picture), flipping its images between pixels and glyphs, and a terminal holding images, or drawing them as glyphs by choice, says petscii:on|off in its tag as an image pane does. TermImages real|petscii (default real) is what a new terminal starts with; it is in DumpConfig, /ctl and the reference. Co-Authored-By: Claude Opus 5.5 --- src/config.zig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/config.zig') diff --git a/src/config.zig b/src/config.zig index 5a9cf070..b6eb4520 100644 --- a/src/config.zig +++ b/src/config.zig @@ -82,6 +82,7 @@ pub const leader_path = paths: { .BootShell = null, .LookWord = null, .Pager = null, + .TermImages = null, .Debug = "td", .Msg = null, .Colors = "tc", @@ -759,14 +760,19 @@ pub const Runtime = struct { /// PAGER and GIT_PAGER set to `pardes -`, a +Pager pane, where the /// user's environment set neither; `off`, the environment as it is. pager: Pager = .pardes, + /// How a new terminal pane draws the kitty graphics its program sends + /// (yazi's previews): `real`, as pixels where the shell can, or + /// `petscii`, as glyph art. The Petscii builtin flips one pane. + term_images: TermImages = .real, pub const ShaderAnimation = enum { off, on, always }; pub const Placement = enum { acme, pardes }; pub const BootShell = enum { keep, replace }; pub const LookWord = enum { search, list }; pub const Pager = enum { pardes, off }; + pub const TermImages = enum { real, petscii }; /// A setting that is one of a few words, each an enum field of Runtime. - pub const Choice = enum { placement, boot_shell, look_word, pager }; + pub const Choice = enum { placement, boot_shell, look_word, pager, term_images }; /// shadow: a soft drop shadow. rim: a light hairline along the top of /// the focused pane's tag rows. auto: a shadow on a light page; on a @@ -1032,6 +1038,7 @@ pub const Runtime = struct { .{ .word = "BootShell", .action = .{ .choice = .boot_shell }, .doc = "A document dropped where a lone untouched shell stands: keep the shell, or replace it." }, .{ .word = "LookWord", .action = .{ .choice = .look_word }, .doc = "A plain word looked at: search selects its next place in the pane, list lists every place in a +Search." }, .{ .word = "Pager", .action = .{ .choice = .pager }, .doc = "What a terminal's commands page through: pardes, a +Pager pane (pardes -), or off, the environment's own; for terminals started after it." }, + .{ .word = "TermImages", .action = .{ .choice = .term_images }, .doc = "How a new terminal draws its program's kitty graphics: real, as pixels where it can, or petscii, as glyph art." }, }; pub fn find(name: []const u8) ?Setting { @@ -1707,6 +1714,7 @@ pub const Runtime = struct { .boot_shell => "replace", .look_word => "list", .pager => "off", + .term_images => "petscii", }, .lift => "rim", .motion => "playful", @@ -1777,6 +1785,7 @@ pub const Runtime = struct { .boot_shell => "BootShell replace\n", .look_word => "LookWord list\n", .pager => "Pager off\n", + .term_images => "TermImages petscii\n", }, .lift => "Lift rim\n", .motion => "Motion playful\n", -- cgit v1.3