From b637c32ef755813c1b1f6f611132c1feb4bb459f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20misaki=20masa?= Date: Thu, 5 Jun 2025 23:03:46 +0800 Subject: [PATCH] feat: increase terminal response timeout to better tolerate slow SSH network environments (#2843) --- 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")) });