From e9164fd20685354a8501cdfc2c98d63fda888ae2 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 5 Jun 2025 23:02:50 +0800 Subject: [PATCH] feat: increase terminal response timeout to better tolerate slow SSH network environments --- yazi-adapter/src/emulator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-adapter/src/emulator.rs b/yazi-adapter/src/emulator.rs index a1ac4815..ef77d842 100644 --- a/yazi-adapter/src/emulator.rs +++ b/yazi-adapter/src/emulator.rs @@ -118,7 +118,7 @@ impl Emulator { let now = std::time::Instant::now(); let h = tokio::spawn(Self::error_to_user()); - let (buf, result) = TTY.read_until(Duration::from_millis(500), |b, buf| { + let (buf, result) = TTY.read_until(Duration::from_millis(1000), |b, buf| { b == b'c' && buf.contains(&0x1b) && buf.rsplitn(2, |&b| b == 0x1b).next().is_some_and(|s| s.starts_with(b"[?")) @@ -137,7 +137,7 @@ impl Emulator { pub fn read_until_dsr() -> String { let now = std::time::Instant::now(); - let (buf, result) = TTY.read_until(Duration::from_millis(100), |b, buf| { + let (buf, result) = TTY.read_until(Duration::from_millis(200), |b, buf| { b == b'n' && (buf.ends_with(b"\x1b[0n") || buf.ends_with(b"\x1b[3n")) });