diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-08 20:55:51 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-09 04:26:19 +0300 |
| commit | ee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 (patch) | |
| tree | f566d2a5921d4112602a7abcffb5cf6eb04d5f24 /src/detect/agents/cursor.rs | |
| parent | a7cd7806f2fa0251e2dca41ffec61ceafb6f0e18 (diff) | |
feat: use pty-first agent detection
Diffstat (limited to 'src/detect/agents/cursor.rs')
| -rw-r--r-- | src/detect/agents/cursor.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/detect/agents/cursor.rs b/src/detect/agents/cursor.rs index a62e9382..f0f00b9b 100644 --- a/src/detect/agents/cursor.rs +++ b/src/detect/agents/cursor.rs @@ -4,7 +4,7 @@ pub(super) fn detect(content: &str) -> AgentState { let lower = content.to_lowercase(); // Blocked - if has_cursor_blocked_prompt(content, &lower) { + if has_visible_blocker(content) { return AgentState::Blocked; } @@ -19,8 +19,12 @@ pub(super) fn detect(content: &str) -> AgentState { AgentState::Idle } -fn has_cursor_blocked_prompt(content: &str, lower: &str) -> bool { - if lower.contains("waiting for approval") || lower.contains("run this command?") { +pub(super) fn has_visible_blocker(content: &str) -> bool { + let lower = content.to_lowercase(); + if lower.contains("waiting for approval") + && lower.contains("run this command?") + && (lower.contains("run (once) (y)") || lower.contains("skip (esc or n)")) + { return true; } |
