From ee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 20:55:51 +0300 Subject: feat: use pty-first agent detection --- src/detect/agents/cursor.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/detect/agents/cursor.rs') 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; } -- cgit v1.2.3