From 3a03ed0585be535d9d0fbc576c48072090162302 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Sat, 17 Jan 2026 18:50:00 +0530 Subject: [PATCH] Fix imgcat aspect ratio by adding preserveAspectRatio=1 Images were being displayed as narrow vertical strips because iTerm2 wasn't preserving aspect ratio when only height was specified. --- crates/g3-core/src/tools/file_ops.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/g3-core/src/tools/file_ops.rs b/crates/g3-core/src/tools/file_ops.rs index 4839c9c..4f6930d 100644 --- a/crates/g3-core/src/tools/file_ops.rs +++ b/crates/g3-core/src/tools/file_ops.rs @@ -738,9 +738,9 @@ pub fn print_imgcat( .file_name() .and_then(|f| f.to_str()) .unwrap_or(name); - // iTerm2 inline image protocol (single space prefix) + // iTerm2 inline image protocol with preserveAspectRatio (single space prefix) print!( - " \x1b]1337;File=inline=1;height={};name={}:{}\x07\n", + " \x1b]1337;File=inline=1;height={};preserveAspectRatio=1;name={}:{}\x07\n", max_height, name, encoded ); // Print dimmed info line with filename only (no │ prefix)