mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
55c4aa580d
commit
31608862f8
1 changed files with 12 additions and 9 deletions
|
|
@ -4,7 +4,7 @@ use anyhow::{bail, Result};
|
||||||
use imagesize::ImageSize;
|
use imagesize::ImageSize;
|
||||||
use ratatui::layout::Rect;
|
use ratatui::layout::Rect;
|
||||||
use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}};
|
use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}};
|
||||||
use tracing::debug;
|
use tracing::{debug, warn};
|
||||||
use yazi_config::PREVIEW;
|
use yazi_config::PREVIEW;
|
||||||
use yazi_shared::RoCell;
|
use yazi_shared::RoCell;
|
||||||
|
|
||||||
|
|
@ -71,14 +71,17 @@ impl Ueberzug {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_demon(adaptor: Adaptor) -> Result<Child> {
|
fn create_demon(adaptor: Adaptor) -> Result<Child> {
|
||||||
Ok(
|
let result = Command::new("ueberzug")
|
||||||
Command::new("ueberzug")
|
|
||||||
.args(["layer", "-so", &adaptor.to_string()])
|
.args(["layer", "-so", &adaptor.to_string()])
|
||||||
.kill_on_drop(true)
|
.kill_on_drop(true)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stderr(Stdio::null())
|
.stderr(Stdio::null())
|
||||||
.spawn()?,
|
.spawn();
|
||||||
)
|
|
||||||
|
if let Err(ref e) = result {
|
||||||
|
warn!("ueberzug spawning failed: {}", e);
|
||||||
|
}
|
||||||
|
Ok(result?)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn adjust_rect(mut rect: Rect) -> Rect {
|
fn adjust_rect(mut rect: Rect) -> Rect {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue