From 3c2b46d24aa6c8011a1e198143752f2aa414d585 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 7 Jun 2026 00:07:24 +0300 Subject: feat: add native windows beta support --- src/app/agent_resume.rs | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'src/app/agent_resume.rs') diff --git a/src/app/agent_resume.rs b/src/app/agent_resume.rs index 8ff6cc4d..894b0b37 100644 --- a/src/app/agent_resume.rs +++ b/src/app/agent_resume.rs @@ -339,6 +339,7 @@ fn shell_quote(value: &str) -> String { mod tests { use super::*; + #[cfg(unix)] fn test_app() -> App { let (_api_tx, api_rx) = tokio::sync::mpsc::unbounded_channel(); App::new( @@ -350,6 +351,21 @@ mod tests { ) } + #[cfg(unix)] + fn long_running_test_argv() -> Vec { + vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()] + } + + #[cfg(unix)] + fn marker_resume_test_argv() -> Vec { + vec![ + "/bin/sh".into(), + "-c".into(), + "printf '%s' 'restored agent: shell quoted | marker'; sleep 5".into(), + ] + } + + #[cfg(unix)] #[tokio::test] async fn pending_agent_resume_waits_for_host_theme_before_launch() { let mut app = test_app(); @@ -371,11 +387,7 @@ mod tests { .expect("test terminal should exist"); terminal.pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec![ - "/bin/sh".into(), - "-c".into(), - "printf '%s' 'restored agent: shell quoted | marker'; sleep 5".into(), - ], + argv: marker_resume_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0codex-session".into(), }); @@ -432,6 +444,7 @@ mod tests { } } + #[cfg(unix)] #[tokio::test] async fn pending_agent_resume_can_launch_after_theme_wait_expires() { let mut app = test_app(); @@ -451,7 +464,7 @@ mod tests { .expect("test terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0codex-session".into(), }); @@ -465,6 +478,7 @@ mod tests { } } + #[cfg(not(windows))] #[tokio::test] async fn pending_agent_resume_launches_hidden_panes_with_current_terminal_area() { let mut app = test_app(); @@ -500,7 +514,7 @@ mod tests { .expect("test terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: format!("herdr:codex\0codex\0Id\0{terminal_id}"), }); } @@ -520,6 +534,7 @@ mod tests { } } + #[cfg(not(windows))] #[tokio::test] async fn pending_agent_resume_launches_inactive_tab_panes_with_current_terminal_area() { let mut app = test_app(); @@ -562,7 +577,7 @@ mod tests { .expect("inactive tab terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0inactive-tab-session".into(), }); @@ -583,6 +598,7 @@ mod tests { } } + #[cfg(not(windows))] #[tokio::test] async fn pending_agent_resume_launches_zoom_hidden_active_tab_panes() { let mut app = test_app(); @@ -620,7 +636,7 @@ mod tests { .expect("hidden zoom pane terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0zoom-hidden-session".into(), }); @@ -641,6 +657,7 @@ mod tests { } } + #[cfg(not(windows))] #[tokio::test] async fn pending_agent_resume_uses_current_terminal_area_for_background_panes() { let mut app = test_app(); @@ -676,7 +693,7 @@ mod tests { .expect("test terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0codex-session".into(), }); @@ -699,6 +716,7 @@ mod tests { } } + #[cfg(unix)] #[tokio::test] async fn pending_agent_resume_launches_with_inner_rect_size() { let mut app = test_app(); @@ -734,7 +752,7 @@ mod tests { .expect("test terminal should exist") .pending_agent_resume_plan = Some(crate::agent_resume::AgentResumePlan { agent: "codex".into(), - argv: vec!["/bin/sh".into(), "-c".into(), "sleep 5".into()], + argv: long_running_test_argv(), dedupe_key: "herdr:codex\0codex\0Id\0codex-session".into(), }); -- cgit v1.2.3