diff options
Diffstat (limited to 'src/terminal.zig')
| -rw-r--r-- | src/terminal.zig | 17 |
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" { |
