Retry wake repaint quickly
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run

This commit is contained in:
DuProcess
2026-07-12 21:08:37 -04:00
parent b2c407ab6e
commit f74495765f
3 changed files with 26 additions and 7 deletions
Generated
+1 -1
View File
@@ -436,7 +436,7 @@ dependencies = [
[[package]]
name = "dosh"
version = "1.0.0-rc37"
version = "1.0.0-rc38"
dependencies = [
"anyhow",
"base64",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "dosh"
version = "1.0.0-rc37"
version = "1.0.0-rc38"
edition = "2024"
license = "MIT"
+24 -5
View File
@@ -75,6 +75,7 @@ const POST_RECONNECT_STALE_INPUT_GRACE: Duration = Duration::from_secs(5);
const FOCUS_REPAINT_COOLDOWN: Duration = Duration::from_secs(1);
const ALT_SCREEN_IDLE_REPAINT_AFTER: Duration = Duration::from_secs(15);
const LOCAL_SLEEP_REPAINT_AFTER: Duration = Duration::from_secs(5);
const LOCAL_SLEEP_REPAINT_RETRY_AFTER: Duration = Duration::from_secs(1);
/// Sentinel `target_host` the server uses on a server-initiated `StreamOpen` that
/// represents an SSH-agent connection (rather than a TCP target). The client
@@ -7324,10 +7325,13 @@ fn should_repaint_idle_terminal(
status_tick_gap: Duration,
now: Instant,
) -> bool {
(alternate_screen
&& now.duration_since(last_terminal_frame_at) >= ALT_SCREEN_IDLE_REPAINT_AFTER
|| status_tick_gap >= LOCAL_SLEEP_REPAINT_AFTER)
&& now.duration_since(last_attempt_at) >= ALT_SCREEN_IDLE_REPAINT_AFTER
let sleep_wake_gap = status_tick_gap >= LOCAL_SLEEP_REPAINT_AFTER;
let stale_alternate_screen = alternate_screen
&& now.duration_since(last_terminal_frame_at) >= ALT_SCREEN_IDLE_REPAINT_AFTER;
if sleep_wake_gap {
return now.duration_since(last_attempt_at) >= LOCAL_SLEEP_REPAINT_RETRY_AFTER;
}
stale_alternate_screen && now.duration_since(last_attempt_at) >= ALT_SCREEN_IDLE_REPAINT_AFTER
}
fn arm_stale_terminal_input_suppression(suppress_until: &mut Option<Instant>) {
@@ -11376,6 +11380,7 @@ mod tests {
let now = Instant::now();
let stale = now - ALT_SCREEN_IDLE_REPAINT_AFTER - Duration::from_secs(1);
let recent = now - Duration::from_secs(1);
let just_attempted = now - Duration::from_millis(500);
assert!(should_repaint_idle_terminal(
true,
stale,
@@ -11390,6 +11395,20 @@ mod tests {
LOCAL_SLEEP_REPAINT_AFTER + Duration::from_secs(1),
now
));
assert!(should_repaint_idle_terminal(
false,
recent,
recent,
LOCAL_SLEEP_REPAINT_AFTER + Duration::from_secs(1),
now
));
assert!(!should_repaint_idle_terminal(
false,
recent,
just_attempted,
LOCAL_SLEEP_REPAINT_AFTER + Duration::from_secs(1),
now
));
assert!(!should_repaint_idle_terminal(
false,
stale,
@@ -11404,7 +11423,7 @@ mod tests {
Duration::from_secs(1),
now
));
assert!(!should_repaint_idle_terminal(
assert!(should_repaint_idle_terminal(
true,
stale,
recent,