Skip to content

Commit

Permalink
fix: use kitty old protocol for Konsole
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jun 4, 2024
1 parent 2c84c48 commit 5f8c20e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ https://github.com/sxyazi/yazi/assets/17523360/92ff23fa-0cd5-4f04-b387-894c12265
| Platform | Protocol | Support |
| ----------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| kitty | [Kitty unicode placeholders](https://sw.kovidgoyal.net/kitty/graphics-protocol/#unicode-placeholders) | ✅ Built-in |
| Konsole | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in |
| Konsole | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adaptor/src/kitty_old.rs) | ✅ Built-in |
| iTerm2 | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in |
| WezTerm | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in |
| Mintty (Git Bash) | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in |
Expand Down
3 changes: 1 addition & 2 deletions yazi-adaptor/src/adaptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ impl Adaptor {
protocols.retain(|p| *p == Self::Iterm2);
if env_exists("ZELLIJ_SESSION_NAME") {
protocols.retain(|p| *p == Self::Sixel);
}
if *TMUX && protocols.len() > 1 {
} else if *TMUX {
protocols.retain(|p| *p != Self::KittyOld);
}
if let Some(p) = protocols.first() {
Expand Down
2 changes: 1 addition & 1 deletion yazi-adaptor/src/emulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Emulator {
match self {
Self::Unknown(adapters) => adapters,
Self::Kitty => vec![Adaptor::Kitty],
Self::Konsole => vec![Adaptor::Iterm2, Adaptor::KittyOld, Adaptor::Sixel],
Self::Konsole => vec![Adaptor::KittyOld],
Self::Iterm2 => vec![Adaptor::Iterm2, Adaptor::Sixel],
Self::WezTerm => vec![Adaptor::Iterm2, Adaptor::Sixel],
Self::Foot => vec![Adaptor::Sixel],
Expand Down
5 changes: 5 additions & 0 deletions yazi-fm/src/app/commands/render.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::{io::{stderr, BufWriter}, sync::atomic::Ordering};

use crossterm::{execute, queue, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}};
use ratatui::{backend::{Backend, CrosstermBackend}, buffer::Buffer, CompletedFrame};
use scopeguard::defer;
use yazi_plugin::elements::COLLISION;

use crate::{app::App, lives::Lives, root::Root};
Expand All @@ -11,6 +13,9 @@ impl App {
return;
};

queue!(stderr(), BeginSynchronizedUpdate).ok();
defer! { execute!(stderr(), EndSynchronizedUpdate).ok(); }

let collision = COLLISION.swap(false, Ordering::Relaxed);
let frame = term
.draw(|f| {
Expand Down

0 comments on commit 5f8c20e

Please sign in to comment.