Skip to content

Commit c172450

Browse files
committed
fix sixel
1 parent f92fee0 commit c172450

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

image/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ pub trait ImageBackend {
2121

2222
pub fn get_best_backend() -> Option<Box<dyn ImageBackend>> {
2323
#[cfg(not(windows))]
24-
if kitty::KittyBackend::supported() {
24+
if sixel::SixelBackend::supported() {
25+
Some(Box::new(sixel::SixelBackend::new()))
26+
} else if kitty::KittyBackend::supported() {
2527
Some(Box::new(kitty::KittyBackend::new()))
2628
} else if iterm::ITermBackend::supported() {
2729
Some(Box::new(iterm::ITermBackend::new()))
28-
} else if sixel::SixelBackend::supported() {
29-
Some(Box::new(sixel::SixelBackend::new()))
3030
} else {
3131
None
3232
}

image/src/sixel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl super::ImageBackend for SixelBackend {
160160
}
161161
image_data.extend(b"\x1B\\");
162162

163-
image_data.extend(format!("\x1B[{}A", image_rows as u32).as_bytes()); // move cursor to top-left corner
163+
image_data.extend(format!("\x1B[{}A", image_rows as u32 - 1).as_bytes()); // move cursor to top-left corner
164164
image_data.extend(format!("\x1B[{}C", image_columns as u32 + 1).as_bytes()); // move cursor to top-right corner of image
165165
let mut i = 0;
166166
for line in &lines {

0 commit comments

Comments
 (0)