Skip to content

Commit

Permalink
Fix sixel support detection
Browse files Browse the repository at this point in the history
  • Loading branch information
shuni64 committed Nov 9, 2019
1 parent 1194f71 commit 745982d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/image_backends/sixel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ impl SixelBackend {
}
buf.push(byte);
if buf.starts_with(&[0x1B, b'[', b'?']) && buf.ends_with(&[b'c']) {
unsafe {
tcsetattr(STDIN_FILENO, TCSANOW, &old_attributes);
for attribute in buf[3..(buf.len() - 1)].split(|x| *x == b';') {
if attribute == &[b'4'] {
unsafe {
tcsetattr(STDIN_FILENO, TCSANOW, &old_attributes);
}
return true;
}
}
return true;
}
}
}
Expand Down

0 comments on commit 745982d

Please sign in to comment.