diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-02 13:58:25 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-02 13:58:25 +0300 |
| commit | 2c422e60f1724ac5639c80abb73dc1f10a91b5c6 (patch) | |
| tree | e18554b708150793e9cbf536cc18107b42844802 /src/detect | |
| parent | 48d58648aefcc59964a99be9c23778fe69346663 (diff) | |
feat: inject powershell prompt shell integration for cwd reporting on windows
refs #919
Diffstat (limited to 'src/detect')
| -rw-r--r-- | src/detect/mod.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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 { |
