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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user