summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 22:59:25 -0300
committerGabriel Schneider <[email protected]>2026-11-05 23:58:31 -0300
commit3ebdbe26a14546f8e4ee06462850aad85f1c9646 (patch)
tree10b81fa631e70d5ec0659ea05bb770587cf99405 /src/terminal.zig
parentdfcc040ac979b695dc2e68b9d866c2769ba6d928 (diff)
downloadpardes-3ebdbe26a14546f8e4ee06462850aad85f1c9646.tar.gz
pardes-3ebdbe26a14546f8e4ee06462850aad85f1c9646.zip
settings #3, the terminal's three go, each the value it had by default: Pager (a terminal's shell pages into a +Pager where the environment names no pager, so PAGER and GIT_PAGER set by the user are what an opt-out is; host_io's Paging.terminal_off goes), PagerColor (a +Pager keeps its program's colours; pager.parse loses its colour argument, its callers in Core.zig and ninep/ctl.zig with it) and TermImages (a new terminal draws its images as pixels where it can, Petscii still flips one; terminal.adoptSettings and its call in panes.zig go); deleted tests: "settings: Pager is pardes by default, off taken, anything else refused with its choices" and "PagerColor off: the same text, no spans, overstrike included" (the man page's overstrike case pins what stays); rewritten: TermImages' test as a new terminal drawing pixels, ctl's pager test with the second +Pager keeping its colours, host_io's environment test for the one terminal paging, process/tree's /commands row on Wrap; the reference, setup and changelog say an environment's PAGER is the way out; no golden changes; gates on tui: core-test 964/964, behaviour-test 241/241, unit-test 1480/1481, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1524/1525
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index 4cde89a4..c9c60b5b 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -3088,13 +3088,6 @@ pub fn petscii(pane: *const Pane) ?bool {
return state.images.petscii;
}
-/// A new terminal takes TermImages: pixels, or glyph art.
-pub fn adoptSettings(p: *const Pardes, pane: *Pane) void {
- if (comptime !images_enabled) return;
- const state = pane.terminal orelse return;
- state.images.petscii = p.settings.term_images == .petscii;
-}
-
/// Whether the screen showing holds any kitty graphics image.
pub fn hasImages(pane: *const Pane) bool {
if (comptime !images_enabled) return false;
@@ -3399,23 +3392,17 @@ test "a terminal's image is a placement whatever the frontend draws, and the Pet
try std.testing.expect(!imagePlaces(s)[0].art.glyph);
}
-test "TermImages is real by default, and petscii makes new terminals draw glyph art" {
+test "a new terminal draws its program's images as pixels, and one without images says nothing of them" {
if (comptime !images_enabled) return error.SkipZigTest;
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 80, .rows = 24, .shells = 1 });
defer p.deinit();
- try std.testing.expectEqual(config.Runtime.TermImages.real, p.settings.term_images);
try std.testing.expectEqual(false, petscii(p.panes[0].?).?);
// A pane without images says nothing of them.
try std.testing.expect(std.mem.indexOf(u8, try tagline.tagPrefix(p, p.panes[0].?), "petscii") == null);
- try std.testing.expect(p.executeBuiltinLine(0, "TermImages petscii"));
- try std.testing.expectEqual(config.Runtime.TermImages.petscii, p.settings.term_images);
- // The setting is for new panes: the one there keeps its choice.
- try std.testing.expectEqual(false, petscii(p.panes[0].?).?);
const id = p.freeSlot().?;
const fresh = try p.newShell(id, "");
- try std.testing.expectEqual(true, petscii(fresh).?);
- try std.testing.expect(std.mem.indexOf(u8, try tagline.tagPrefix(p, fresh), " petscii:on") != null);
+ try std.testing.expectEqual(false, petscii(fresh).?);
}
test "a program asking the cell size in pixels (CSI 16 t) is told the shell's" {