From 2c422e60f1724ac5639c80abb73dc1f10a91b5c6 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 2 Jul 2026 13:58:25 +0300 Subject: feat: inject powershell prompt shell integration for cwd reporting on windows refs #919 --- src/detect/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/detect') diff --git a/src/detect/mod.rs b/src/detect/mod.rs index e88d5e5d..cd350331 100644 --- a/src/detect/mod.rs +++ b/src/detect/mod.rs @@ -888,6 +888,28 @@ mod tests { ); } + // A plain shell pane launched with herdr's injected prompt integration + // must still classify as a shell, not an agent, even though its argv now + // carries a -Command payload. + #[test] + fn identify_agent_in_job_ignores_herdr_powershell_shell_integration_argv() { + let job = crate::platform::ForegroundJob { + process_group_id: 123, + processes: vec![foreground_process( + 1, + "powershell.exe", + &[ + "powershell.exe", + "-NoExit", + "-Command", + crate::pane::WINDOWS_POWERSHELL_SHELL_INTEGRATION_COMMAND, + ], + )], + }; + + assert_eq!(identify_agent_in_job(&job), None); + } + #[test] fn identify_agent_in_job_detects_opencode_exe_from_pnpm_package() { let job = crate::platform::ForegroundJob { -- cgit v1.2.3