fix(inner-loop): improve ANSI escape code stripping

Expand ANSI regex to match all escape sequences (cursor movement,
color codes, etc.) not just color codes. This fixes todo content
having residual escape sequences like cursor movements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 17:19:15 +01:00
co-authored by Claude Opus 4.5
parent 684ccc2b07
commit 11569933a3
+2 -1
View File
@@ -43,7 +43,8 @@ const MAX_ITERATIONS_PATTERN = /max[_-]?iterations?\s*[=:]\s*(\d+)/i;
const TODOWRITE_PATTERN = /TodoWrite|todo(?:s)?\s*(?:updated|written|saved)|Todos have been modified/i;
// ANSI escape code removal for cleaner parsing
const ANSI_ESCAPE_PATTERN = /\x1b\[[0-9;]*m/g;
// Matches color codes (\x1b[...m), cursor movement (\x1b[...H, \x1b[...C, etc.), and other sequences
const ANSI_ESCAPE_PATTERN = /\x1b\[[0-9;]*[A-Za-z]/g;
export interface InnerLoopTrackerEvents {
loopUpdate: (state: InnerLoopState) => void;