mirror of
https://github.com/sxyazi/yazi.git
synced 2026-05-13 08:16:40 +00:00
refactor: async Command over emitting shell actions (#3706)
This commit is contained in:
parent
e49cdfe220
commit
d84f0b1265
20 changed files with 137 additions and 136 deletions
|
|
@ -11,8 +11,9 @@ use yazi_dds::Pubsub;
|
|||
use yazi_fs::{File, FilesOp, Splatter, max_common_root, path::skip_url, provider::{FileBuilder, Provider, local::{Gate, Local}}};
|
||||
use yazi_macro::{err, succ};
|
||||
use yazi_parser::VoidOpt;
|
||||
use yazi_proxy::{AppProxy, HIDER, NotifyProxy, TasksProxy};
|
||||
use yazi_proxy::{AppProxy, NotifyProxy, TasksProxy};
|
||||
use yazi_shared::{data::Data, path::PathDyn, strand::{AsStrand, AsStrandJoin, Strand, StrandBuf, StrandLike}, terminal_clear, url::{AsUrl, UrlBuf, UrlCow, UrlLike}};
|
||||
use yazi_term::YIELD_TO_SUBPROCESS;
|
||||
use yazi_tty::TTY;
|
||||
use yazi_vfs::{VfsFile, maybe_exists, provider};
|
||||
use yazi_watcher::WATCHER;
|
||||
|
|
@ -66,7 +67,7 @@ impl Actor for BulkRename {
|
|||
)
|
||||
.await;
|
||||
|
||||
let _permit = Permit::new(HIDER.acquire().await.unwrap(), AppProxy::resume());
|
||||
let _permit = Permit::new(YIELD_TO_SUBPROCESS.acquire().await.unwrap(), AppProxy::resume());
|
||||
AppProxy::stop().await;
|
||||
|
||||
let new: Vec<_> = Local::regular(&tmp)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use anyhow::Result;
|
||||
use yazi_macro::succ;
|
||||
use yazi_parser::mgr::PeekOpt;
|
||||
use yazi_proxy::HIDER;
|
||||
use yazi_shared::data::Data;
|
||||
|
||||
use crate::{Actor, Ctx};
|
||||
|
|
@ -17,7 +16,7 @@ impl Actor for Peek {
|
|||
let Some(hovered) = cx.hovered().cloned() else {
|
||||
succ!(cx.tab_mut().preview.reset());
|
||||
};
|
||||
if HIDER.try_acquire().is_err() {
|
||||
if cx.term.is_none() {
|
||||
succ!(cx.tab_mut().preview.reset_image());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ use tokio::{io::{AsyncReadExt, stdin}, select, sync::mpsc, time};
|
|||
use yazi_binding::Permit;
|
||||
use yazi_macro::succ;
|
||||
use yazi_parser::VoidOpt;
|
||||
use yazi_proxy::{AppProxy, HIDER};
|
||||
use yazi_proxy::AppProxy;
|
||||
use yazi_shared::{data::Data, terminal_clear};
|
||||
use yazi_term::YIELD_TO_SUBPROCESS;
|
||||
use yazi_tty::TTY;
|
||||
|
||||
use crate::{Actor, Ctx};
|
||||
|
|
@ -27,7 +28,7 @@ impl Actor for Inspect {
|
|||
};
|
||||
|
||||
tokio::spawn(async move {
|
||||
let _permit = Permit::new(HIDER.acquire().await.unwrap(), AppProxy::resume());
|
||||
let _permit = Permit::new(YIELD_TO_SUBPROCESS.acquire().await.unwrap(), AppProxy::resume());
|
||||
let (tx, mut rx) = mpsc::unbounded_channel();
|
||||
|
||||
let buffered = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue