terminal: lower default kitty image storage limit for libghostty

The default kitty image storage limit was 320 MB for all build
artifacts. For libghostty, this is overly generous since it is an
embedded library where conservative memory usage is preferred.
Lower the default to 10 MB when building as the lib artifact while
keeping the 320 MB default for the full Ghostty application.
This commit is contained in:
Mitchell Hashimoto
2026-04-06 06:56:03 -07:00
parent 306acc4941
commit 810ebae8e8
2 changed files with 12 additions and 2 deletions

View File

@@ -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)

View File

@@ -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,