diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index f93ec999c..b56701838 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -255,7 +255,10 @@ pub const Options = struct { /// The total storage limit for Kitty images in bytes for this /// screen. Kitty image storage is per-screen. - kitty_image_storage_limit: usize = 320 * 1000 * 1000, // 320MB + kitty_image_storage_limit: usize = switch (build_options.artifact) { + .ghostty => 320 * 1000 * 1000, // 320MB + .lib => 10 * 1000 * 1000, // 10MB + }, /// The limits for what medium types are allowed for Kitty image loading. kitty_image_loading_limits: if (build_options.kitty_graphics) diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index b128cdd3d..f6268c719 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -194,7 +194,14 @@ pub const Options = struct { /// The total storage limit for Kitty images in bytes. Has no effect /// if kitty images are disabled at build-time. - kitty_image_storage_limit: usize = 320 * 1000 * 1000, // 320MB + kitty_image_storage_limit: usize = switch (build_options.artifact) { + .ghostty => 320 * 1000 * 1000, // 320MB + + // libghostty we start with a much lower limit since this is an + // embedded library and we want to be more conservative with memory + // usage by default. + .lib => 10 * 1000 * 1000, // 10MB + }, /// The limits for what medium types are allowed for Kitty image loading. /// Has no effect if kitty images are disabled otherwise. For example,