From 719dff6d3cefbe586403d5a8454b119df4ec3ccd Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Wed, 3 Jun 2026 02:23:47 +0300 Subject: fix: detect claude arrow-glyph question prompts --- src/detect/agents/claude_code.rs | 5 ++++- src/detect/mod.rs | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/detect/agents/claude_code.rs b/src/detect/agents/claude_code.rs index 819dadf4..0918f5a2 100644 --- a/src/detect/agents/claude_code.rs +++ b/src/detect/agents/claude_code.rs @@ -99,7 +99,10 @@ fn has_live_blocked_form(content: &str) -> bool { lower.contains("enter to select") && lower.contains("esc to cancel") && (lower.contains("tab/arrow keys to navigate") - || lower.contains("arrow keys to navigate")) + || lower.contains("arrow keys to navigate") + || lower.contains("arrows to navigate") + || lower.contains("↑/↓ to navigate") + || lower.contains("↑↓ to navigate")) }) } diff --git a/src/detect/mod.rs b/src/detect/mod.rs index ff27892b..a1084e06 100644 --- a/src/detect/mod.rs +++ b/src/detect/mod.rs @@ -999,6 +999,16 @@ mod tests { assert!(!detection.visible_idle); } + #[test] + fn claude_question_form_with_arrow_glyph_footer_is_visible_blocker() { + let screen = "❯ this is a test can you use question otol to ask questiosns\n\n Thought for 16s (ctrl+o to expand)\n─────────────────────────────────────────────────────────────────────────────────────────\n ☐ Test type\n\nWhich kind of test question should I ask you next?\n\n❯ 1. Single choice\n Ask one multiple-choice question.\n 2. Multi choice\n Ask one question that allows several answers.\n 3. With preview\n Ask with side-by-side previews.\n 4. Type something.\n─────────────────────────────────────────────────────────────────────────────────────────\n 5. Chat about this\n\nEnter to select · ↑/↓ to navigate · Esc to cancel"; + let detection = detect_agent(Some(Agent::Claude), screen); + + assert_eq!(detection.state, AgentState::Blocked); + assert!(detection.visible_blocker); + assert!(!detection.visible_idle); + } + #[test] fn claude_question_form_selected_bottom_is_visible_blocker() { let screen = "❯ ask again\n─────────────────────────────────────────────────────────────────────────────────────────\n← ☐ Subject ☐ Tone ✔ Submit →\n\nWhat should I ask you about?\n\n 1. Today\n Your current plan or priority.\n 2. Project\n A codebase, feature, bug, or PR.\n 3. Preference\n How you want me to work with you.\n 4. Random\n A casual question with no work context.\n 5. Type something.\n─────────────────────────────────────────────────────────────────────────────────────────\n❯ 6. Chat about this\n\nEnter to select · Tab/Arrow keys to navigate · ctrl+g to edit in Zed · Esc to cancel"; -- cgit v1.2.3